From 487e9861d0cf83e9100ad0d0369147db3ef4ea73 Mon Sep 17 00:00:00 2001 From: Alvaro Herrera Date: Wed, 18 Mar 2020 18:58:05 -0300 Subject: Enable BEFORE row-level triggers for partitioned tables ... with the limitation that the tuple must remain in the same partition. Reviewed-by: Ashutosh Bapat Discussion: https://postgr.es/m/20200227165158.GA2071@alvherre.pgsql --- src/backend/commands/tablecmds.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/backend/commands/tablecmds.c') diff --git a/src/backend/commands/tablecmds.c b/src/backend/commands/tablecmds.c index 8c33b67c1b5..729025470dc 100644 --- a/src/backend/commands/tablecmds.c +++ b/src/backend/commands/tablecmds.c @@ -16546,7 +16546,8 @@ CloneRowTriggersToPartition(Relation parent, Relation partition) /* * Complain if we find an unexpected trigger type. */ - if (!TRIGGER_FOR_AFTER(trigForm->tgtype)) + if (!TRIGGER_FOR_BEFORE(trigForm->tgtype) && + !TRIGGER_FOR_AFTER(trigForm->tgtype)) elog(ERROR, "unexpected trigger \"%s\" found", NameStr(trigForm->tgname)); -- cgit v1.2.3