pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alvaro Herrera <alvherre@alvh.no-ip.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Allow FOR EACH ROW triggers on partitioned tables
Date: Fri, 23 Mar 2018 13:48:53 +0000
Message-ID: <E1ezN3t-0005Bt-9a@gemulon.postgresql.org> (raw)

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

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/86f575948c773b0ec5b0f27066e37dd93a7f0a96

Modified Files
--------------
doc/src/sgml/catalogs.sgml                 |   8 +
doc/src/sgml/ref/create_trigger.sgml       |   7 +
src/backend/catalog/heap.c                 |   1 +
src/backend/catalog/index.c                |   4 +-
src/backend/catalog/pg_constraint.c        |   3 +
src/backend/commands/tablecmds.c           | 150 ++++++++++++-
src/backend/commands/trigger.c             | 313 +++++++++++++++++++++++---
src/backend/commands/typecmds.c            |   1 +
src/backend/tcop/utility.c                 |   3 +-
src/include/catalog/catversion.h           |   2 +-
src/include/catalog/indexing.h             |   2 +
src/include/catalog/pg_constraint.h        |  39 ++--
src/include/catalog/pg_constraint_fn.h     |   1 +
src/include/commands/trigger.h             |   5 +-
src/test/regress/expected/oidjoins.out     |   8 +
src/test/regress/expected/triggers.out     | 344 +++++++++++++++++++++++++++--
src/test/regress/input/constraints.source  |  16 ++
src/test/regress/output/constraints.source |  26 +++
src/test/regress/sql/oidjoins.sql          |   4 +
src/test/regress/sql/triggers.sql          | 234 +++++++++++++++++++-
20 files changed, 1078 insertions(+), 93 deletions(-)



view thread (5+ messages)  latest in thread

Message-ID: <E1ezN3t-0005Bt-9a@gemulon.postgresql.org>
Permalink:  ../E1ezN3t-0005Bt-9a@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1ezN3t-0005Bt-9a@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: alvherre@alvh.no-ip.org
  Subject: Re: pgsql: Allow FOR EACH ROW triggers on partitioned tables
  In-Reply-To: <E1ezN3t-0005Bt-9a@gemulon.postgresql.org>
  References: <E1ezN3t-0005Bt-9a@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox