Commit e798d095 authored by Alvaro Herrera's avatar Alvaro Herrera

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 578b2297

Discussion: https://postgr.es/m/20210503231633.GA6994@alvherre.pgsql
parent c98a6d78
...@@ -10319,7 +10319,7 @@ ATExecAlterConstraint(Relation rel, AlterTableCmd *cmd, ...@@ -10319,7 +10319,7 @@ ATExecAlterConstraint(Relation rel, AlterTableCmd *cmd,
copy_tg->tginitdeferred = cmdcon->initdeferred; copy_tg->tginitdeferred = cmdcon->initdeferred;
CatalogTupleUpdate(tgrel, &copyTuple->t_self, copyTuple); CatalogTupleUpdate(tgrel, &copyTuple->t_self, copyTuple);
InvokeObjectPostAlterHook(TriggerRelationId, currcon->oid, 0); InvokeObjectPostAlterHook(TriggerRelationId, tgform->oid, 0);
heap_freetuple(copyTuple); heap_freetuple(copyTuple);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment