> ERROR_LIMIT '<replaceable class="parameter">limit_number</replaceable>' > > I think this should be: > > ERROR_LIMIT <replaceable class="parameter">limit_number</replaceable> > > (no single quote)
Thank you .Fixed
More comments:
- I think the document should stat that if limit_number = 0, all errors are immediately raised (behaves same as current befavior without the patch).
if we want all error to be raised error limit_number not need to be specified.
but if it is specified like limit_number = 0 i think it is self-explanatory
- "constraint violating rows will be returned back to the caller." This does explains the current implementation. I am not sure if it's intended or not though:
cat /tmp/a 1 1 2 2 3 3 3 4
psql test $ psql test psql (13devel) Type "help" for help.
test=# select * from t1; i | j ---+--- 1 | 1 2 | 2 3 | 3 (3 rows)
test=# copy t1 from '/tmp/a' with (error_limit 1); ERROR: duplicate key value violates unique constraint "t1_pkey" DETAIL: Key (i)=(2) already exists. CONTEXT: COPY t1, line 2: "2 2"
So if the number of errors raised exceeds error_limit, no constaraint violating rows (in this case i=1, j=1) are returned.
error_limit is specified to dictate the number of error allowed in copy operation
to precede. If it exceed the number the operation is stopped. there may
be more conflict afterward and returning limited number of conflicting rows