Repository navigation
feat(schema): ignore column-neutral ALTER TABLE actions and EXCLUDE - #65
Merged
omer-cengel merged 1 commit intoOct 10, 2026
Merged
Conversation
ALTER TABLE actions that cannot change a column's existence, name, type, or nullability are now ignored: SET/DROP DEFAULT, SET STATISTICS, STORAGE, and COMPRESSION, DROP EXPRESSION, identity changes, row-level security switches, partition attachment, OWNER TO, trigger and rule switches, VALIDATE CONSTRAINT, REPLICA IDENTITY, clustering, storage parameters, tablespace, logging, access method, inheritance, and OF. Actions the parser reports only as trailing text are split at top-level commas and each one must be such an action, so a modeled action written after one is rejected instead of skipped. Any other action is rejected as "Unsupported ALTER TABLE action: <action> at line <n>". CREATE TABLE now accepts EXCLUDE table constraints without recording them.
omer-cengel
deleted the
feature/ignore-column-neutral-alter-table-actions
branch
October 10, 2026 14:09
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.
Summary
Real migration histories and
pg_dump --schema-onlysnapshots contain manyALTER TABLEactions that never change a column, such asOWNER TO,SET DEFAULT, identity changes, and row-level security switches, andCREATE TABLEstatements withEXCLUDEconstraints. These were rejected, so such schemas could not load. They are now ignored. Any other action is still rejected, and the diagnostic now quotes the offending action.Changes
ALTER COLUMNactions that cannot change a column's type or nullability:SET/DROP DEFAULT,SET STATISTICS,SET STORAGE,SET COMPRESSION,DROP EXPRESSION, and identity changes (ADD GENERATED ... AS IDENTITY,SET GENERATED, sequence options,RESTART,DROP IDENTITY). The column itself is not looked up.ATTACH/DETACH PARTITION,OWNER TO, trigger and rule switches,VALIDATE CONSTRAINT,REPLICA IDENTITY,CLUSTER ON,SET WITHOUT CLUSTER,SET WITHOUT OIDS, storage parameters,SET TABLESPACE,SET LOGGED/UNLOGGED,SET ACCESS METHOD,[NO] INHERIT, and[NOT] OF. The table must still exist unlessIF EXISTSis given.OWNER TO app, ADD COLUMN x int, is rejected instead of being silently skipped.Unsupported ALTER TABLE action: <action> at line <n>, for exampleSET SCHEMA archive.CREATE TABLEaccepts named and unnamedEXCLUDEtable constraints and does not record them.Scope and non-goals
ADD/DROP/RENAME COLUMN,RENAME TO,TYPE,SET/DROP NOT NULL) behave as before.SET SCHEMAstays rejected.ALTER TYPEactions and their messages are unchanged.ALTER COLUMN ... SET DATA TYPE,ALTER COLUMN ... SET (...), andALTER CONSTRAINT, keep their existing handling.ALTER TABLEare still not recorded.KEY/INDEXtable constraints stay rejected.