Re: POC PATCH: copy from ... exceptions to: (was Re: VLDB Features)

Andrei Lepikhov <a.lepikhov@postgrespro.ru>

From: Andrei Lepikhov <a.lepikhov@postgrespro.ru>
To: Damir Belyalov <dam.bel07@gmail.com>, zhihuifan1213@163.com
Cc: Tom Lane <tgl@sss.pgh.pa.us>, Daniel Gustafsson <daniel@yesql.se>, torikoshia <torikoshia@oss.nttdata.com>, PostgreSQL Hackers <pgsql-hackers@postgresql.org>, Andres Freund <andres@anarazel.de>, anisimow.d@gmail.com, HukuToc@gmail.com, Alena Rybakina <lena.ribackina@yandex.ru>, pgsql-hackers@lists.postgresql.org
Date: 2023-11-24T03:52:25Z
Lists: pgsql-hackers

Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. doc: Fix COPY ON_ERROR option syntax synopsis.

  2. Disallow specifying ON_ERROR option without value.

  3. Rename COPY option from SAVE_ERROR_TO to ON_ERROR

  4. Fix spelling in notice

  5. Add new COPY option SAVE_ERROR_TO

On 14/11/2023 17:10, Damir Belyalov wrote:
>       Here is a very straw-man-level sketch of what I think might work.
>       The option to COPY FROM looks something like
> 
>            ERRORS TO other_table_name (item [, item [, ...]])
> 
> 
> I tried to implement the patch using a table and came across a number of 
> questions.
> 
> Which table should we implement for this feature: a system catalog table 
> or store this table as a file or create a new table?
> 
> In these cases, security and user rights management issues arise.
> It is better for other users not to see error lines from another user. 
> It is also not clear how access rights to this table are inherited and 
> be given.

Previous reviews have given helpful ideas about storing errors in the 
new table.
It should be trivial code - use the current table name + 'err' + suffix 
as we already do in the case of conflicting auto-generated index names.
The 'errors table' must inherit any right policies from the table, to 
which we do the copy.

-- 
regards,
Andrei Lepikhov
Postgres Professional