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

Bugfix: support filtering out only some of the partitions #863

Merged
merged 3 commits into from
Aug 6, 2024

Conversation

hanefi
Copy link
Contributor

@hanefi hanefi commented Aug 5, 2024

We have a bug when migrating some partitioned tables and some partitions are excluded from the migration.

PostgreSQL command TRUNCATE ONLY does not support partitioned tables, and following errors happen if the command is used on partitioned tables:

ERROR:  cannot truncate only a partitioned table
HINT:  Do not specify the ONLY keyword, or use TRUNCATE ONLY on the partitions directly.
ERROR:  cannot truncate only a partitioned table
SQL query: TRUNCATE ONLY partitioned_tables.sellers

Related: #700
Closes: #856

PostgreSQL command `TRUNCATE ONLY` does not support partitioned tables.
This commit adds a test case to ensure that the `TRUNCATE ONLY` command
is not used on partitioned tables.

ERROR:  cannot truncate only a partitioned table
HINT:  Do not specify the ONLY keyword, or use TRUNCATE ONLY on the partitions directly.
ERROR:  cannot truncate only a partitioned table
SQL query: TRUNCATE ONLY partitioned_tables.sellers
@hanefi hanefi changed the title Reproduce failures when filtering partitions Bugfix: support filtering out only some of the partitions Aug 5, 2024
@hanefi hanefi marked this pull request as ready for review August 5, 2024 19:06
@dimitri dimitri added the bug Something isn't working label Aug 6, 2024
@dimitri dimitri added this to the v0.17 milestone Aug 6, 2024
@dimitri dimitri merged commit 941817e into dimitri:main Aug 6, 2024
19 checks passed
@hanefi hanefi deleted the partition-truncate-only-bug branch August 13, 2024 16:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Clone fails with multiple "ERROR: cannot truncate only a partitioned table"
2 participants