Re: POC PATCH: copy from ... exceptions to: (was Re: VLDB Features)
Daniel Gustafsson <daniel@yesql.se>
From: Daniel Gustafsson <daniel@yesql.se>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Damir <dam.bel07@gmail.com>,
torikoshia <torikoshia@oss.nttdata.com>,
PostgreSQL Hackers <pgsql-hackers@postgresql.org>,
Andres Freund <andres@anarazel.de>,
anisimow.d@gmail.com,
HukuToc@gmail.com,
Andrey Lepikhov <a.lepikhov@postgrespro.ru>,
Alena Rybakina <lena.ribackina@yandex.ru>
Date: 2023-11-08T19:34:51Z
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 →
-
doc: Fix COPY ON_ERROR option syntax synopsis.
- f6f8ac8e75c9 17.0 landed
-
Disallow specifying ON_ERROR option without value.
- a6d0fa5ef840 17.0 landed
-
Rename COPY option from SAVE_ERROR_TO to ON_ERROR
- b725b7eec431 17.0 landed
-
Fix spelling in notice
- 58fbbc9d683c 17.0 landed
-
Add new COPY option SAVE_ERROR_TO
- 9e2d8701194f 17.0 landed
> On 8 Nov 2023, at 19:18, Tom Lane <tgl@sss.pgh.pa.us> wrote: > I think an actually usable feature of this sort would involve > copying all the failed lines to some alternate output medium, > perhaps a second table with a TEXT column to receive the original > data line. (Or maybe an array of text that could receive the > broken-down field values?) Maybe we could dump the message info, > line number, field name etc into additional columns. I agree that the errors should be easily visible to the user in some way. The feature is for sure interesting, especially in data warehouse type jobs where dirty data is often ingested. As a data point, Greenplum has this feature with additional SQL syntax to control it: COPY .. LOG ERRORS SEGMENT REJECT LIMIT xyz ROWS; LOG ERRORS instructs the database to log the faulty rows and SEGMENT REJECT LIMIT xyz ROWS sets the limit of how many rows can be faulty before the operation errors out. I'm not at all advocating that we should mimic this, just wanted to add a reference to postgres derivative where this has been implemented. -- Daniel Gustafsson