Add REJECT_LIMIT option to the COPY command.
commit4ac2a9beceb10d44806d2cf157d5a931bdade39e
authorFujii Masao <fujii@postgresql.org>
Tue, 8 Oct 2024 09:19:58 +0000 (8 18:19 +0900)
committerFujii Masao <fujii@postgresql.org>
Tue, 8 Oct 2024 09:19:58 +0000 (8 18:19 +0900)
tree129027bdf5e2ed13e83087631fb769ad30feee3f
parentd759c1a0b864366d3592203c782027825ec4c8c8
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
doc/src/sgml/ref/copy.sgml
src/backend/commands/copy.c
src/backend/commands/copyfrom.c
src/include/commands/copy.h
src/test/regress/expected/copy2.out
src/test/regress/sql/copy2.sql