From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Doc: note that statement-level view triggers require an INSTEAD
Date: Sun, 18 Mar 2018 19:10:54 +0000
Message-ID: <E1exdhm-0003N3-73@gemulon.postgresql.org> (raw)
Doc: note that statement-level view triggers require an INSTEAD OF trigger.
If a view lacks an INSTEAD OF trigger, DML on it can only work by rewriting
the command into a command on the underlying base table(s). Then we will
fire triggers attached to those table(s), not those for the view. This
seems appropriate from a consistency standpoint, but nowhere was the
behavior explicitly documented, so let's do that.
There was some discussion of throwing an error or warning if a statement
trigger is created on a view without creating a row INSTEAD OF trigger.
But a simple implementation of that would result in dump/restore ordering
hazards. Given that it's been like this all along, and we hadn't heard
a complaint till now, a documentation improvement seems sufficient.
Per bug #15106 from Pu Qun. Back-patch to all supported branches.
Discussion: https://postgr.es/m/152083391168.1215.16892140713507052796@wrigleys.postgresql.org
Branch
------
REL9_3_STABLE
Details
-------
https://git.postgresql.org/pg/commitdiff/60c23ff76b1fdabd7c1adcdb00adfb11c77b04dc
Modified Files
--------------
doc/src/sgml/ref/create_trigger.sgml | 13 +++++++++++++
doc/src/sgml/trigger.sgml | 12 +++++++++---
2 files changed, 22 insertions(+), 3 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: Doc: note that statement-level view triggers require an INSTEAD
In-Reply-To: <E1exdhm-0003N3-73@gemulon.postgresql.org>
References: <E1exdhm-0003N3-73@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