-
Notifications
You must be signed in to change notification settings - Fork 549
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
INSERT INTO SELECT
does not throw an error / warning when some inserts fail
#12218
Comments
Discussion outcome: Could add a session setting that allows partial failures and causes a "fail fast" behavior (first error encountered gets propagated) |
Starting from version 5.5,
The new session setting should behave in a similar way for |
One possible option to give back a warning could be by means of a |
We had another discussion about this and concluded that the Partly because of bulk request handling where individual "batch" error reporting would work via HTTP, but is problematic for PostgreSQL. PG/DB-API clients typically only expose a row-count array or failure, not one failure per batch. The other main advantage of a It's more effort to implement, as it also requires a HTTP response format addition and updates in crash and the admin-ui to show the warnings. It won't make it for 5.7. We can target this for 5.8 instead but that's TBD We could (later) also additionally add a |
Main user facing problem: Confusion if some rows are not inserted (for example because of constraint violation). Listing all possible options to change behaviour from the user perspective to get additional feedback:
|
CrateDB version
4.6.8 / 4.7.0
Steps to Reproduce
Expected Result
Statement fails with
Actual Result
no error, just
INSERT OK, 1 record affected (0.011 seconds)
a lower number than expected
Update
This might not be a bug after all, however the situation could be maybe improved to give the user some way to check if an
INSERT INTO SELECT
partially failed.returns
COPY FROM
has the optionRETURN SUMMARY
to see how many rows failed to be copied and now also thefail_fast
option to stop copy operations in best effort manner when insert error occur.Possible solution
The text was updated successfully, but these errors were encountered: