postgres.git / summary / log / commit / refs

commit    e798d095da3a4a4bb5c50bb3dff886f07ef52f55
Author:   Alvaro Herrera <alvherre@alvh.no-ip.org>
Date:     Tue May 04 14:09:12 2021 +0000
First released in: 14.0, 12.7, 13.3

    Fix OID passed to object-alter hook during ALTER CONSTRAINT
    
    The OID of the constraint is used instead of the OID of the trigger --
    an easy mistake to make.  Apparently the object-alter hooks are not very
    well tested :-(
    
    Backpatch to 12, where this typo was introduced by 578b229718e8
    
    Discussion: https://postgr.es/m/20210503231633.GA6994@alvherre.pgsql


src/backend/commands/tablecmds.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/backend/commands/tablecmds.c b/src/backend/commands/tablecmds.c index 4142ada820f..a992f1bef80 100644 --- a/src/backend/commands/tablecmds.c +++ b/src/backend/commands/tablecmds.c @@ -10319,7 +10319,7 @@ ATExecAlterConstraint(Relation rel, AlterTableCmd *cmd, copy_tg->tginitdeferred = cmdcon->initdeferred; CatalogTupleUpdate(tgrel, &copyTuple->t_self, copyTuple); - InvokeObjectPostAlterHook(TriggerRelationId, currcon->oid, 0); + InvokeObjectPostAlterHook(TriggerRelationId, tgform->oid, 0); heap_freetuple(copyTuple); } [parent: c98a6d7887ea]