summaryrefslogtreecommitdiff
path: root/doc/src
diff options
context:
space:
mode:
authorAlvaro Herrera <alvherre@alvh.no-ip.org>2018-03-23 10:48:22 -0300
committerAlvaro Herrera <alvherre@alvh.no-ip.org>2018-03-23 10:48:22 -0300
commit86f575948c773b0ec5b0f27066e37dd93a7f0a96 (patch)
tree564d827795d68a7628429d08043c3ee87c635e9c /doc/src
parent5700aa130186e0b5d600806645b051bfd9067f09 (diff)
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
Diffstat (limited to 'doc/src')
-rw-r--r--doc/src/sgml/catalogs.sgml8
-rw-r--r--doc/src/sgml/ref/create_trigger.sgml7
2 files changed, 15 insertions, 0 deletions
diff --git a/doc/src/sgml/catalogs.sgml b/doc/src/sgml/catalogs.sgml
index c030cdab4be..95a5b113b98 100644
--- a/doc/src/sgml/catalogs.sgml
+++ b/doc/src/sgml/catalogs.sgml
@@ -2255,6 +2255,14 @@ SCRAM-SHA-256$<replaceable>&lt;iteration count&gt;</replaceable>:<replaceable>&l
</row>
<row>
+ <entry><structfield>conparentid</structfield></entry>
+ <entry><type>oid</type></entry>
+ <entry><literal><link linkend="catalog-pg-constraint"><structname>pg_constraint</structname></link>.oid</literal></entry>
+ <entry>The corresponding constraint in the parent partitioned table,
+ if this is a constraint in a partition; else 0</entry>
+ </row>
+
+ <row>
<entry><structfield>confrelid</structfield></entry>
<entry><type>oid</type></entry>
<entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.oid</literal></entry>
diff --git a/doc/src/sgml/ref/create_trigger.sgml b/doc/src/sgml/ref/create_trigger.sgml
index 784ed5b8e02..7b971ee6b43 100644
--- a/doc/src/sgml/ref/create_trigger.sgml
+++ b/doc/src/sgml/ref/create_trigger.sgml
@@ -513,6 +513,13 @@ UPDATE OF <replaceable>column_name1</replaceable> [, <replaceable>column_name2</
</para>
<para>
+ Creating a row-level trigger on a partitioned table will cause identical
+ triggers to be created in all its existing partitions; and any partitions
+ created or attached later will contain an identical trigger, too.
+ Triggers on partitioned tables may only be <literal>AFTER</literal>.
+ </para>
+
+ <para>
Modifying a partitioned table or a table with inheritance children fires
statement-level triggers attached to the explicitly named table, but not
statement-level triggers for its partitions or child tables. In contrast,