mirror of
https://github.com/postgres/postgres.git
synced 2025-07-31 22:04:40 +03:00
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
This commit is contained in:
@ -2254,6 +2254,14 @@ SCRAM-SHA-256$<replaceable><iteration count></replaceable>:<replaceable>&l
|
||||
key, foreign key, or exclusion constraint; else 0</entry>
|
||||
</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>
|
||||
|
@ -512,6 +512,13 @@ UPDATE OF <replaceable>column_name1</replaceable> [, <replaceable>column_name2</
|
||||
the ones that are fired.
|
||||
</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
|
||||
|
Reference in New Issue
Block a user