From: Fujii Masao <fujii@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Add REJECT_LIMIT option to the COPY command.
Date: Tue, 08 Oct 2024 09:23:00 +0000
Message-ID: <E1sy6Qm-002fZF-EW@gemulon.postgresql.org> (raw)
Add REJECT_LIMIT option to the COPY command.
Previously, when ON_ERROR was set to 'ignore', the COPY command
would skip all rows with data type conversion errors, with no way to
limit the number of skipped rows before failing.
This commit introduces the REJECT_LIMIT option, allowing users to
specify the maximum number of erroneous rows that can be skipped.
If more rows encounter data type conversion errors than allowed by
REJECT_LIMIT, the COPY command will fail with an error, even when
ON_ERROR = 'ignore'.
Author: Atsushi Torikoshi
Reviewed-by: Junwang Zhao, Kirill Reshke, jian he, Fujii Masao
Discussion: https://postgr.es/m/63f99327aa6b404cc951217fa3e61fe4@oss.nttdata.com
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/4ac2a9beceb10d44806d2cf157d5a931bdade39e
Modified Files
--------------
doc/src/sgml/ref/copy.sgml | 19 +++++++++++++++++++
src/backend/commands/copy.c | 33 +++++++++++++++++++++++++++++++++
src/backend/commands/copyfrom.c | 7 +++++++
src/include/commands/copy.h | 1 +
src/test/regress/expected/copy2.out | 10 ++++++++++
src/test/regress/sql/copy2.sql | 21 +++++++++++++++++++++
6 files changed, 91 insertions(+)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-committers@postgresql.org
Cc: fujii@postgresql.org, pgsql-committers@lists.postgresql.org
Subject: Re: pgsql: Add REJECT_LIMIT option to the COPY command.
In-Reply-To: <E1sy6Qm-002fZF-EW@gemulon.postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
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