Skip to content
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

Improve copy_data error handling #499

Merged
merged 1 commit into from
Feb 25, 2023
Merged

Conversation

larskanis
Copy link
Collaborator

Make sure an error in put_copy_end doesn't lose the original exception.

Use a dedicated error class PG::LostCopyState for errors due to another query while COPYing and mention that it's probably due to another query. Previously the "no COPY in progress" PG::Error was less specific.

Remove transactions around the "another query" specs, previously the put_copy_data direction had a double fault due to another query while transaction is in error state.

Use discard_result which we have now and which does essentially what previous error handling did.

Cleanup temporary tables after running.

Move definition of error classes to exception.rb, where they better fit into.

Make sure an error in put_copy_end doesn't lose the original exception.

Use a dedicated error class PG::LostCopyState for errors due to another query while COPYing and mention that it's probably due to another query.
Previously the "no COPY in progress" PG::Error was less specific.

Remove transactions around the "another query" specs, previously the put_copy_data direction had a double fault due to another query while transaction is in error state.

Use discard_result which we have now and which does essentially what previous error handling did.

Cleanup temporary tables after running.

Move definition of error classes to exception.rb, where they better fit into.
@larskanis larskanis merged commit 73733ac into ged:master Feb 25, 2023
@larskanis larskanis deleted the improve_copy_data branch February 25, 2023 14:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant