aboutsummaryrefslogtreecommitdiff
path: root/src/include/commands/trigger.h
diff options
context:
space:
mode:
authorAlvaro Herrera <alvherre@alvh.no-ip.org>2021-07-16 13:01:43 -0400
committerAlvaro Herrera <alvherre@alvh.no-ip.org>2021-07-16 13:01:43 -0400
commit7584ec1f60980ee855aa34d8159f7f9cddc289af (patch)
tree0a322faac6730aca6e7f288465ce1738421a8e0c /src/include/commands/trigger.h
parentb242e1d239df238d612ad7037a1218cc47c641a4 (diff)
downloadpostgresql-7584ec1f60980ee855aa34d8159f7f9cddc289af.tar.gz
postgresql-7584ec1f60980ee855aa34d8159f7f9cddc289af.zip
Preserve firing-on state when cloning row triggers to partitions
When triggers are cloned from partitioned tables to their partitions, the 'tgenabled' flag (origin/replica/always/disable) was not propagated. Make it so that the flag on the trigger on partition is initially set to the same value as on the partitioned table. Add a test case to verify the behavior. Backpatch to 11, where this appeared in commit 86f575948c77. Author: Álvaro Herrera <alvherre@alvh.no-ip.org> Reported-by: Justin Pryzby <pryzby@telsasoft.com> Discussion: https://postgr.es/m/20200930223450.GA14848@telsasoft.com
Diffstat (limited to 'src/include/commands/trigger.h')
-rw-r--r--src/include/commands/trigger.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/include/commands/trigger.h b/src/include/commands/trigger.h
index a46feeedb0b..5dbd74799d8 100644
--- a/src/include/commands/trigger.h
+++ b/src/include/commands/trigger.h
@@ -161,6 +161,11 @@ extern ObjectAddress CreateTrigger(CreateTrigStmt *stmt, const char *queryString
Oid relOid, Oid refRelOid, Oid constraintOid, Oid indexOid,
Oid funcoid, Oid parentTriggerOid, Node *whenClause,
bool isInternal, bool in_partition);
+extern ObjectAddress CreateTriggerFiringOn(CreateTrigStmt *stmt, const char *queryString,
+ Oid relOid, Oid refRelOid, Oid constraintOid,
+ Oid indexOid, Oid funcoid, Oid parentTriggerOid,
+ Node *whenClause, bool isInternal, bool in_partition,
+ char trigger_fires_when);
extern void RemoveTriggerById(Oid trigOid);
extern Oid get_trigger_oid(Oid relid, const char *name, bool missing_ok);