From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Provide the OR REPLACE option for CREATE TRIGGER.
Date: Sat, 14 Nov 2020 22:05:46 +0000
Message-ID: <E1ke3g2-0005xw-Hz@gemulon.postgresql.org> (raw)
Provide the OR REPLACE option for CREATE TRIGGER.
This is mostly straightforward. However, we disallow replacing
constraint triggers or changing the is-constraint property; perhaps
that can be added later, but the complexity versus benefit tradeoff
doesn't look very good.
Also, no special thought is taken here for whether replacing an
existing trigger should result in changes to queued-but-not-fired
trigger actions. We just document that if you're surprised by the
results, too bad, don't do that. (Note that any such pending trigger
activity would have to be within the current session.)
Takamichi Osumi, reviewed at various times by Surafel Temesgen,
Peter Smith, and myself
Discussion: https://postgr.es/m/0DDF369B45A1B44B8A687ED43F06557C010BC362@G01JPEXMBYT03
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/92bf7e2d027466d750b4ac5b026f6f4ac29be881
Modified Files
--------------
doc/src/sgml/ref/create_trigger.sgml | 76 +++++++++-----
src/backend/catalog/index.c | 7 +-
src/backend/commands/tablecmds.c | 28 +++---
src/backend/commands/trigger.c | 174 +++++++++++++++++++++++----------
src/backend/nodes/copyfuncs.c | 3 +-
src/backend/nodes/equalfuncs.c | 3 +-
src/backend/parser/gram.y | 52 +++++-----
src/include/nodes/parsenodes.h | 3 +-
src/test/regress/expected/triggers.out | 89 +++++++++++++++++
src/test/regress/sql/triggers.sql | 87 +++++++++++++++++
10 files changed, 408 insertions(+), 114 deletions(-)
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: tgl@sss.pgh.pa.us
Subject: Re: pgsql: Provide the OR REPLACE option for CREATE TRIGGER.
In-Reply-To: <E1ke3g2-0005xw-Hz@gemulon.postgresql.org>
References: <E1ke3g2-0005xw-Hz@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