diff options
author | Peter Eisentraut | 2025-03-25 12:40:24 +0000 |
---|---|---|
committer | Peter Eisentraut | 2025-03-25 12:40:24 +0000 |
commit | f4b2a62ae3147ab262eaa21f8be76e569ffd8dfa (patch) | |
tree | ca4b306a5896c82692d96101508e3767b9e22be1 /src/backend/commands | |
parent | 62f36d6924c740b5a566d64c563789d20cd4a5e1 (diff) |
Small fixes for Add ALTER TABLE ... ALTER CONSTRAINT ... SET [NO] INHERIT
Small fixes for commit f4e53e10b6c: Add missing calls to
InvokeObjectPostAlterHook() and also CacheInvalidateRelcache(). The
former change could have a user-visible effect. The latter omission
might have caused other bugs, but it is not clear whether one actually
existed. With these changes, the code is now more consistent with
similar ALTER CONSTRAINT variants, especially the ones that set the
deferrability.
Reviewed-by: Álvaro Herrera <[email protected]>
Discussion: https://postgr.es/m/CAF1DzPVfOW6Kk=7SSh7LbneQDJWh=PbJrEC_Wkzc24tHOyQWGg@mail.gmail.com
Diffstat (limited to 'src/backend/commands')
-rw-r--r-- | src/backend/commands/tablecmds.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/backend/commands/tablecmds.c b/src/backend/commands/tablecmds.c index 1202544ebd0..4974536e084 100644 --- a/src/backend/commands/tablecmds.c +++ b/src/backend/commands/tablecmds.c @@ -12151,10 +12151,16 @@ ATExecAlterConstraintInternal(List **wqueue, ATAlterConstraint *cmdcon, copy_con->connoinherit = cmdcon->noinherit; CatalogTupleUpdate(conrel, ©Tuple->t_self, copyTuple); + + InvokeObjectPostAlterHook(ConstraintRelationId, currcon->oid, 0); + CommandCounterIncrement(); heap_freetuple(copyTuple); changed = true; + /* Make new constraint flags visible to others */ + CacheInvalidateRelcache(rel); + /* Fetch the column number and name */ colNum = extractNotNullColumn(contuple); colName = get_attname(currcon->conrelid, colNum, false); |