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

Check that a table still exists before running COPY. #748

Merged
merged 1 commit into from
Apr 17, 2024

Conversation

dimitri
Copy link
Owner

@dimitri dimitri commented Apr 17, 2024

In Postgres pg_dump, the situation of a DROP TABLE happening concurrently to the backup operation is prevented by taking an explicit ACCESS SHARE lock on all the tables early.

This approach is limited to max_locks_per_transaction and can be problematic to operate given large schemas.

In the context of pgcopydb though, we do not need to forbid DROP TABLE happening on the source server while the migration is running, we need to be able to skip a table that has been dropped before we get to COPY it.

In Postgres pg_dump, the situation of a DROP TABLE happening concurrently to
the backup operation is prevented by taking an explicit ACCESS SHARE lock on
all the tables early.

This approach is limited to max_locks_per_transaction and can be problematic
to operate given large schemas.

In the context of pgcopydb though, we do not need to forbid DROP TABLE
happening on the source server while the migration is running, we need to be
able to skip a table that has been dropped before we get to COPY it.
@dimitri dimitri added enhancement New feature or request good first issue Good for newcomers labels Apr 17, 2024
@dimitri dimitri added this to the v0.16 milestone Apr 17, 2024
@dimitri dimitri self-assigned this Apr 17, 2024
@dimitri dimitri merged commit 7ae034e into main Apr 17, 2024
18 checks passed
@dimitri dimitri deleted the feature/check-table-still-exists-before-copy branch April 17, 2024 16:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant