From: Andres Freund <andres@anarazel.de>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Use slots in trigger infrastructure, except for the actual invoc
Date: Wed, 27 Feb 2019 04:41:28 +0000
Message-ID: <E1gyr28-0004d8-5t@gemulon.postgresql.org> (raw)
Use slots in trigger infrastructure, except for the actual invocation.
In preparation for abstracting table storage, convert trigger.c to
track tuples in slots. Which also happens to make code calling
triggers simpler.
As the calling interface for triggers themselves is not changed in
this patch, HeapTuples still are extracted from the slot at that
time. But that's handled solely inside trigger.c, not visible to
callers. It's quite likely that we'll want to revise the external
trigger interface, but that's a separate large project.
As part of this work the slots used for old/new/return tuples are
moved from EState into ResultRelInfo, as different updated tables
might need different slots. The slots are now also now created
on-demand, which is good both from an efficiency POV, but also makes
the modifying code simpler.
Author: Andres Freund, Amit Khandekar and Ashutosh Bapat
Discussion: https://postgr.es/m/20180703070645.wchpu5muyto5n647@alap3.anarazel.de
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/ff11e7f4b9ae017585c3ba146db7ba39c31f209a
Modified Files
--------------
contrib/postgres_fdw/postgres_fdw.c | 16 +-
src/backend/commands/copy.c | 24 +-
src/backend/commands/tablecmds.c | 2 -
src/backend/commands/trigger.c | 673 ++++++++++++++++---------------
src/backend/executor/execMain.c | 6 +-
src/backend/executor/execReplication.c | 25 +-
src/backend/executor/execTuples.c | 4 +
src/backend/executor/execUtils.c | 69 +++-
src/backend/executor/nodeModifyTable.c | 166 +++-----
src/backend/replication/logical/worker.c | 5 -
src/backend/utils/adt/ri_triggers.c | 187 +++++----
src/include/commands/trigger.h | 24 +-
src/include/executor/executor.h | 4 +
src/include/nodes/execnodes.h | 8 +-
14 files changed, 642 insertions(+), 571 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: andres@anarazel.de
Subject: Re: pgsql: Use slots in trigger infrastructure, except for the actual invoc
In-Reply-To: <E1gyr28-0004d8-5t@gemulon.postgresql.org>
References: <E1gyr28-0004d8-5t@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