diff options
| author | Tom Lane <tgl@sss.pgh.pa.us> | 2023-03-04 13:32:35 -0500 |
|---|---|---|
| committer | Tom Lane <tgl@sss.pgh.pa.us> | 2023-03-04 13:32:35 -0500 |
| commit | 6949b921d545809a83f8a6bad4948f9012a76fb6 (patch) | |
| tree | 6646b139d5256411c11b570c8eeb70a8ee6329aa /src/include | |
| parent | f62975b2af6ace276a1d564a070b0aef479025af (diff) | |
Avoid failure when altering state of partitioned foreign-key triggers.
Beginning in v15, if you apply ALTER TABLE ENABLE/DISABLE TRIGGER to
a partitioned table, it also affects the partitions' cloned versions
of the affected trigger(s). The initial implementation of this
located the clones by name, but that fails on foreign-key triggers
which have names incorporating their own OIDs. We can fix that, and
also make the behavior more bulletproof in the face of user-initiated
trigger renames, by identifying the cloned triggers by tgparentid.
Following the lead of earlier commits in this area, I took care not
to break ABI in the v15 branch, even though I rather doubt there
are any external callers of EnableDisableTrigger.
While here, update the documentation, which was not touched when
the semantics were changed.
Per bug #17817 from Alan Hodgson. Back-patch to v15; older versions
do not have this behavior.
Discussion: https://postgr.es/m/17817-31dfb7c2100d9f3d@postgresql.org
Diffstat (limited to 'src/include')
| -rw-r--r-- | src/include/commands/trigger.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/include/commands/trigger.h b/src/include/commands/trigger.h index 39d764dac70..67496d84f98 100644 --- a/src/include/commands/trigger.h +++ b/src/include/commands/trigger.h @@ -170,7 +170,7 @@ extern Oid get_trigger_oid(Oid relid, const char *trigname, bool missing_ok); extern ObjectAddress renametrig(RenameStmt *stmt); -extern void EnableDisableTrigger(Relation rel, const char *tgname, +extern void EnableDisableTrigger(Relation rel, const char *tgname, Oid tgparent, char fires_when, bool skip_system, bool recurse, LOCKMODE lockmode); |
