Repository navigation
Drop a partitioned table together with its partitions - #174
Merged
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
LucaCappelletti94
force-pushed
the
upstream/drop-partitioned-table
branch
from
October 28, 2026 21:48
598b219 to
56907f2
Compare
LucaCappelletti94
changed the base branch from
upstream/attach-partition-of
to
main
October 28, 2026 21:48
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.
DROP TABLEon a partitioned table was refused while it had partitions, because every table below the dropped one was treated like anINHERITSchild that onlyCASCADEmay take along. PostgreSQL drops a partitioned table's partitions with it on its own, nested and attached ones included, and keeps requiringCASCADEonly forINHERITSchildren. The drop now follows that, and dropping a partition leaves its root standing.Since partitions now leave with their root, a view reading one of them or a foreign key pointing at one from a table that stays holds the drop back the same way it does for the named table, and
CASCADEremoves the view or cuts the key. The cascadedINHERITSdrop gains the same view removal, which used to leave views on the children behind. Every name in the statement resolves before anything is dropped, as in PostgreSQL, soDROP TABLE p, cdrops both and an absent name is reported before anything changes.This stacks on #172 because
maincannot build against the current sqlparser until that one merges.