]> granicus.if.org Git - postgresql/commit
Allow FOR EACH ROW triggers on partitioned tables
authorAlvaro Herrera <alvherre@alvh.no-ip.org>
Fri, 23 Mar 2018 13:48:22 +0000 (10:48 -0300)
committerAlvaro Herrera <alvherre@alvh.no-ip.org>
Fri, 23 Mar 2018 13:48:22 +0000 (10:48 -0300)
commit86f575948c773b0ec5b0f27066e37dd93a7f0a96
tree564d827795d68a7628429d08043c3ee87c635e9c
parent5700aa130186e0b5d600806645b051bfd9067f09
Allow FOR EACH ROW triggers on partitioned tables

Previously, FOR EACH ROW triggers were not allowed in partitioned
tables.  Now we allow AFTER triggers on them, and on trigger creation we
cascade to create an identical trigger in each partition.  We also clone
the triggers to each partition that is created or attached later.

This means that deferred unique keys are allowed on partitioned tables,
too.

Author: Álvaro Herrera
Reviewed-by: Peter Eisentraut, Simon Riggs, Amit Langote, Robert Haas,
Thomas Munro
Discussion: https://postgr.es/m/20171229225319.ajltgss2ojkfd3kp@alvherre.pgsql
20 files changed:
doc/src/sgml/catalogs.sgml
doc/src/sgml/ref/create_trigger.sgml
src/backend/catalog/heap.c
src/backend/catalog/index.c
src/backend/catalog/pg_constraint.c
src/backend/commands/tablecmds.c
src/backend/commands/trigger.c
src/backend/commands/typecmds.c
src/backend/tcop/utility.c
src/include/catalog/catversion.h
src/include/catalog/indexing.h
src/include/catalog/pg_constraint.h
src/include/catalog/pg_constraint_fn.h
src/include/commands/trigger.h
src/test/regress/expected/oidjoins.out
src/test/regress/expected/triggers.out
src/test/regress/input/constraints.source
src/test/regress/output/constraints.source
src/test/regress/sql/oidjoins.sql
src/test/regress/sql/triggers.sql