pgsql: Rationalize expression context reset in ExecModifyTable(). - Mailing list pgsql-committers

From Andres Freund
Subject pgsql: Rationalize expression context reset in ExecModifyTable().
Date
Msg-id E1gNNZW-0006sv-HH@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Rationalize expression context reset in ExecModifyTable().

The current pattern of reseting expressions both in
ExecProcessReturning() and ExecOnConflictUpdate() makes it harder than
necessary to reason about memory lifetimes.  It also requires
materializing slots unnecessarily, although this patch doesn't take
advantage of the fact that that's not necessary anymore.

Instead reset the expression context once for each input tuple.

Author: Ashutosh Bapat
Discussion: https://postgr.es/m/20181105210039.hh4vvi4vwoq5ba2q@alap3.anarazel.de

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/c058fc2a2b8ea25015b211186c88a6a3006f5937

Modified Files
--------------
src/backend/executor/nodeModifyTable.c | 22 +++++++++-------------
1 file changed, 9 insertions(+), 13 deletions(-)


pgsql-committers by date:

Previous
From: Andres Freund
Date:
Subject: pgsql: Make reformat-dat-files, reformat-dat-files VPATH safe.
Next
From: Peter Eisentraut
Date:
Subject: pgsql: Correct code comments for PartitionedRelPruneInfo struct