From: Kevin Grittner <kgrittn@postgresql.org>
To: pgsql-committers@postgresql.org
Subject: pgsql: Follow-on cleanup for the transition table patch.
Date: Tue, 04 Apr 2017 23:46:54 +0000
Message-ID: <E1cvYA2-0008M6-4c@gemulon.postgresql.org> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-committers>
Follow-on cleanup for the transition table patch.
Commit 59702716 added transition table support to PL/pgsql so that
SQL queries in trigger functions could access those transient
tables. In order to provide the same level of support for PL/perl,
PL/python and PL/tcl, refactor the relevant code into a new
function SPI_register_trigger_data. Call the new function in the
trigger handler of all four PLs, and document it as a public SPI
function so that authors of out-of-tree PLs can do the same.
Also get rid of a second QueryEnvironment object that was
maintained by PL/pgsql. That was previously used to deal with
cursors, but the same approach wasn't appropriate for PLs that are
less tangled up with core code. Instead, have SPI_cursor_open
install the connection's current QueryEnvironment, as already
happens for SPI_execute_plan.
While in the docs, remove the note that transition tables were only
supported in C and PL/pgSQL triggers, and correct some ommissions.
Thomas Munro with some work by Kevin Grittner (mostly docs)
Branch
------
master
Details
-------
http://git.postgresql.org/pg/commitdiff/5ebeb579b9b281dba5f8415b2fbda86fdae7b366
Modified Files
--------------
doc/src/sgml/ref/create_trigger.sgml | 10 +--
doc/src/sgml/spi.sgml | 125 ++++++++++++++++++++++++++
doc/src/sgml/trigger.sgml | 54 +++++++++--
src/backend/executor/spi.c | 52 +++++++++++
src/include/executor/spi.h | 3 +
src/pl/plperl/expected/plperl_trigger.out | 29 ++++++
src/pl/plperl/plperl.c | 7 ++
src/pl/plperl/sql/plperl_trigger.sql | 32 +++++++
src/pl/plpgsql/src/pl_exec.c | 49 +---------
src/pl/plpgsql/src/plpgsql.h | 4 -
src/pl/plpython/expected/plpython_trigger.out | 21 +++++
src/pl/plpython/plpy_exec.c | 5 ++
src/pl/plpython/sql/plpython_trigger.sql | 24 +++++
src/pl/tcl/expected/pltcl_queries.out | 21 +++++
src/pl/tcl/pltcl.c | 5 ++
src/pl/tcl/sql/pltcl_queries.sql | 20 +++++
16 files changed, 398 insertions(+), 63 deletions(-)
--
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers
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: kgrittn@postgresql.org
Subject: Re: pgsql: Follow-on cleanup for the transition table patch.
In-Reply-To: <E1cvYA2-0008M6-4c@gemulon.postgresql.org>
References: <E1cvYA2-0008M6-4c@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