pgsql: Add REJECT_LIMIT option to the COPY command. - Mailing list pgsql-committers

From Fujii Masao
Subject pgsql: Add REJECT_LIMIT option to the COPY command.
Date
Msg-id E1sy6Qm-002fZF-EW@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
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(+)


pgsql-committers by date:

Previous
From: Amit Kapila
Date:
Subject: pgsql: Stabilize the test added by commit 022564f60c.
Next
From: Fujii Masao
Date:
Subject: pgsql: Move check for binary mode and on_error option to the appropriat