Rationalize expression context reset in ExecModifyTable().
authorAndres Freund <andres@anarazel.de>
Tue, 13 Nov 2018 20:18:25 +0000 (12:18 -0800)
committerAndres Freund <andres@anarazel.de>
Thu, 15 Nov 2018 19:40:50 +0000 (11:40 -0800)
commitc058fc2a2b8ea25015b211186c88a6a3006f5937
tree32c71bf0a7ce90d86c32b500bb2e27c6118d3dd3
parent6a744413ea0c0c114348c4c010aa9f909c83d3f3
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
src/backend/executor/nodeModifyTable.c