pg.ddx.io pgsql-committers@postgresql.org mailing list archive
help / color / mirror / Atom feedpgsql: Add new COPY option SAVE_ERROR_TO
2+ messages / 2 participants
[nested] [flat]
* pgsql: Add new COPY option SAVE_ERROR_TO
@ 2024-01-16 21:35 Alexander Korotkov <akorotkov@postgresql.org>
0 siblings, 1 reply; 2+ messages in thread
From: Alexander Korotkov @ 2024-01-16 21:35 UTC (permalink / raw)
To: pgsql-committers@lists.postgresql.org
Add new COPY option SAVE_ERROR_TO
Currently, when source data contains unexpected data regarding data type or
range, the entire COPY fails. However, in some cases, such data can be ignored
and just copying normal data is preferable.
This commit adds a new option SAVE_ERROR_TO, which specifies where to save the
error information. When this option is specified, COPY skips soft errors and
continues copying.
Currently, SAVE_ERROR_TO only supports "none". This indicates error information
is not saved and COPY just skips the unexpected data and continues running.
Later works are expected to add more choices, such as 'log' and 'table'.
Author: Damir Belyalov, Atsushi Torikoshi, Alex Shulgin, Jian He
Discussion: https://postgr.es/m/87k31ftoe0.fsf_-_%40commandprompt.com
Reviewed-by: Pavel Stehule, Andres Freund, Tom Lane, Daniel Gustafsson,
Reviewed-by: Alena Rybakina, Andy Fan, Andrei Lepikhov, Masahiko Sawada
Reviewed-by: Vignesh C, Atsushi Torikoshi
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/9e2d8701194fa1d280b73c024759950c74c1c637
Modified Files
--------------
doc/src/sgml/ref/copy.sgml | 23 ++++++++++++++-
src/backend/commands/copy.c | 49 ++++++++++++++++++++++++++++++++
src/backend/commands/copyfrom.c | 48 +++++++++++++++++++++++++++++++
src/backend/commands/copyfromparse.c | 17 +++++++----
src/bin/psql/tab-complete.c | 7 ++++-
src/include/commands/copy.h | 11 +++++++
src/include/commands/copyfrom_internal.h | 5 ++++
src/test/regress/expected/copy2.out | 43 ++++++++++++++++++++++++++++
src/test/regress/sql/copy2.sql | 42 +++++++++++++++++++++++++++
src/tools/pgindent/typedefs.list | 1 +
10 files changed, 239 insertions(+), 7 deletions(-)
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: pgsql: Add new COPY option SAVE_ERROR_TO
@ 2024-01-16 22:52 Alexander Korotkov <aekorotkov@gmail.com>
parent: Alexander Korotkov <akorotkov@postgresql.org>
0 siblings, 0 replies; 2+ messages in thread
From: Alexander Korotkov @ 2024-01-16 22:52 UTC (permalink / raw)
To: Alexander Korotkov <akorotkov@postgresql.org>; +Cc: pgsql-committers@lists.postgresql.org
On Tue, Jan 16, 2024 at 11:35 PM Alexander Korotkov
<akorotkov@postgresql.org> wrote:
> https://git.postgresql.org/pg/commitdiff/9e2d8701194fa1d280b73c024759950c74c1c637
I'm looking at this failure...
https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=turaco&dt=2024-01-16%2022%3A21%3A27
------
Regards,
Alexander Korotkov
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2024-01-16 22:52 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2024-01-16 21:35 pgsql: Add new COPY option SAVE_ERROR_TO Alexander Korotkov <akorotkov@postgresql.org>
2024-01-16 22:52 ` Alexander Korotkov <aekorotkov@gmail.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox