1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-03 20:02:46 +03:00

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
This commit is contained in:
Alvaro Herrera
2020-03-18 18:58:05 -03:00
parent b029395f5e
commit 487e9861d0
8 changed files with 161 additions and 23 deletions

View File

@ -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));