pgsql: Use slots in trigger infrastructure, except for the actual invoc

From: Andres Freund <andres(at)anarazel(dot)de>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Use slots in trigger infrastructure, except for the actual invoc
Date: 2019-02-27 04:41:28
Message-ID: E1gyr28-0004d8-5t@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

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(-)

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message John Naylor 2019-02-27 05:19:18 Re: pgsql: Avoid creation of the free space map for small heap relations, t
Previous Message Amit Kapila 2019-02-27 04:05:49 Re: pgsql: Avoid creation of the free space map for small heap relations, t