Skip to content

Commit f4b2a62

Browse files
committed
Small fixes for Add ALTER TABLE ... ALTER CONSTRAINT ... SET [NO] INHERIT
Small fixes for commit f4e53e1: 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 <alvherre@alvh.no-ip.org> Discussion: https://postgr.es/m/CAF1DzPVfOW6Kk=7SSh7LbneQDJWh=PbJrEC_Wkzc24tHOyQWGg@mail.gmail.com
1 parent 62f36d6 commit f4b2a62

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/backend/commands/tablecmds.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12151,10 +12151,16 @@ ATExecAlterConstraintInternal(List **wqueue, ATAlterConstraint *cmdcon,
1215112151
copy_con->connoinherit = cmdcon->noinherit;
1215212152

1215312153
CatalogTupleUpdate(conrel, &copyTuple->t_self, copyTuple);
12154+
12155+
InvokeObjectPostAlterHook(ConstraintRelationId, currcon->oid, 0);
12156+
1215412157
CommandCounterIncrement();
1215512158
heap_freetuple(copyTuple);
1215612159
changed = true;
1215712160

12161+
/* Make new constraint flags visible to others */
12162+
CacheInvalidateRelcache(rel);
12163+
1215812164
/* Fetch the column number and name */
1215912165
colNum = extractNotNullColumn(contuple);
1216012166
colName = get_attname(currcon->conrelid, colNum, false);

0 commit comments

Comments
 (0)