Repository navigation
Fold ALTER TABLE ATTACH PARTITION into the partition hierarchy - #172
Merged
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
This was referenced Oct 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
sqlparser
mainnow parses PostgreSQL'sALTER TABLE root ATTACH PARTITION part FOR VALUES ...asAlterTableOperation::AttachPartitionOf(apache/datafusion-sqlparser-rs#2749), and the exhaustiveALTER TABLEmatch in sql-traits stopped compiling against it. Every crate following both onmainfails to build until this lands.The operation is applied to the catalog.
pg_dumpwrites every partition as a plainCREATE TABLEfollowed byALTER TABLE ONLY root ATTACH PARTITION, so skipping it would read every dumped partitioned schema back with no partitions at all. The attached table gets the same edgeCREATE TABLE ... PARTITION OFrecords, so later changes to the root reach it through the existing walks. What it receives follows PostgreSQL 18.6 for this statement. It keeps its own column order and defaults, takes the root's keys, foreign keys and identity, keeps a key or foreign key it already holds under its own name, and a partitioned table passes the root's keys on to its own partitions.PostgreSQL refuses a mismatched table at attach time, and those refusals are modelled with a new
Error::PartitionNotAttachablecarrying anUnattachablePartitionreason, next to the existing type, collation, check and temporary storage errors. The lockfiles move sqlparser to5989f9cein a commit of their own.