Skip to content

Fix COPY FROM when ON_ERROR ignore and REJECT_LIMIT are present - #10856

Merged
RobAtticus merged 1 commit into
mainfrom
rrk/copy-on-error-ignore
Oct 28, 2026
Merged

RobAtticus merged 1 commit into
mainfrom
rrk/copy-on-error-ignore

Conversation

@RobAtticus

Copy link
Copy Markdown
Member

In PG17, COPY statements added support for ON_ERROR ignore which would skip rows where an error occurred. The intercepted version here did not handle this syntax and instead added bogus values for both the row where an error occurred and those afterwards.

In PG18, COPY statements added support for REJECT_LIMIT which would rollback a COPY if a certain number of errors occurred. The intercepted version here did not handle this either and instead continued inserting (incorrect) rows and did not rollback.

Closes #10854 and #10855

@github-actions

Copy link
Copy Markdown

@kpan2034, @natalya-aksman: please review this pull request.

Powered by pull-review

@RobAtticus

Copy link
Copy Markdown
Member Author

This code is basically lifted from Postgres with minimal adjustments.

@codecov

codecov Bot commented Oct 19, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 91.66667% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/copy.c 91.66% 0 Missing and 1 partial ⚠️

πŸ“’ Thoughts on this report? Let us know!

@RobAtticus
RobAtticus force-pushed the rrk/copy-on-error-ignore branch from b750f91 to 1947431 Compare October 20, 2026 15:45
@RobAtticus

Copy link
Copy Markdown
Member Author

Fuzzer failure is known: #10439 (comment)

@RobAtticus RobAtticus added this to the v2.31.1 milestone Oct 22, 2026
@RobAtticus
RobAtticus force-pushed the rrk/copy-on-error-ignore branch from 1947431 to 5bb1aaa Compare October 22, 2026 13:33
In PG17, COPY statements added support for `ON_ERROR ignore` which
would skip rows where an error occurred. The intercepted version here
did not handle this syntax and instead added bogus values for both
the row where an error occurred and those afterwards.

In PG18, COPY statements added support for `REJECT_LIMIT` which would
rollback a COPY if a certain number of errors occurred. The intercepted
version here did not handle this either and instead continued inserting
(incorrect) rows and did not rollback.
@RobAtticus
RobAtticus force-pushed the rrk/copy-on-error-ignore branch from 5bb1aaa to 93af22c Compare October 28, 2026 14:38
@RobAtticus
RobAtticus enabled auto-merge (rebase) October 28, 2026 16:14
@RobAtticus
RobAtticus merged commit 3cc2bb2 into main Oct 28, 2026
76 of 78 checks passed
@RobAtticus
RobAtticus deleted the rrk/copy-on-error-ignore branch October 28, 2026 17:21
@timescale-automation timescale-automation added the released-2.32.0 Released in 2.32.0 label Nov 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: COPY into hypertable does not respect REJECT_LIMIT in PG18 [Bug]: COPY into hypertable does not respect ON_ERROR ignore

4 participants