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 <[email protected]>
Reviewed-by: Paul A Jungwirth <[email protected]>
Discussion: 
https://www.postgresql.org/message-id/flat/CANE55rCqcse_pwXBMWhbj3_7XROb8Dks6%3DOLFmKy3bO3zDsCsg%40mail.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(+)

Reply via email to