mirror of
https://github.com/postgres/postgres.git
synced 2025-11-04 20:11:56 +03:00
Fix ALTER TABLE code to update domain constraints when needed.
It's possible for dropping a column, or altering its type, to require changes in domain CHECK constraint expressions; but the code was previously only expecting to find dependent table CHECK constraints. Make the necessary adjustments. This is a fairly old oversight, but it's a lot easier to encounter the problem in the context of domains over composite types than it was before. Given the lack of field complaints, I'm not going to bother with a back-patch, though I'd be willing to reconsider that decision if someone does complain. Patch by me, reviewed by Michael Paquier Discussion: https://postgr.es/m/30656.1509128130@sss.pgh.pa.us
This commit is contained in:
@@ -1713,6 +1713,7 @@ typedef enum AlterTableType
|
||||
AT_AddConstraint, /* add constraint */
|
||||
AT_AddConstraintRecurse, /* internal to commands/tablecmds.c */
|
||||
AT_ReAddConstraint, /* internal to commands/tablecmds.c */
|
||||
AT_ReAddDomainConstraint, /* internal to commands/tablecmds.c */
|
||||
AT_AlterConstraint, /* alter constraint */
|
||||
AT_ValidateConstraint, /* validate constraint */
|
||||
AT_ValidateConstraintRecurse, /* internal to commands/tablecmds.c */
|
||||
|
||||
Reference in New Issue
Block a user