pgsql: Fix cross-leftover pollution in FOR PORTION OF insert triggers
Fix cross-leftover pollution in FOR PORTION OF insert triggers
When we insert temporal leftovers after an UPDATE FOR PORTION OF, we
must make a new copy of the tuple before each insert. Otherwise, if
an insert trigger assigns to attributes of NEW, the second leftover
sees those changes.
Author: Sergei Patiakin <sergei.patiakin@enterprisedb.com>
Reviewed-by: Paul A Jungwirth <pj@illuminatedcomputing.com>
Discussion: /messages/by-id/CANE55rCqcse_pwXBMWhbj3_7XROb8Dks6=OLFmKy3bO3zDsCsg@mail.gmail.com
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/993a7aa0e4af0922ac86d8914e0e78fc38fb0daf
Modified Files
--------------
src/backend/executor/nodeModifyTable.c | 12 +++++++++
src/test/regress/expected/for_portion_of.out | 38 ++++++++++++++++++++++++++++
src/test/regress/sql/for_portion_of.sql | 38 ++++++++++++++++++++++++++++
3 files changed, 88 insertions(+)