]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Fix cross-leftover pollution in FOR PORTION OF insert triggers
authorPeter Eisentraut <peter@eisentraut.org>
Thu, 4 Jun 2026 09:12:58 +0000 (11:12 +0200)
committerPeter Eisentraut <peter@eisentraut.org>
Thu, 4 Jun 2026 09:13:16 +0000 (11:13 +0200)
commit993a7aa0e4af0922ac86d8914e0e78fc38fb0daf
tree5dad2ff86709765cc4cae76e26c5eeb193f9226e
parent90354030b8fceecef9a1908fdefcccf0e02823fb
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: https://www.postgresql.org/message-id/flat/CANE55rCqcse_pwXBMWhbj3_7XROb8Dks6%3DOLFmKy3bO3zDsCsg%40mail.gmail.com
src/backend/executor/nodeModifyTable.c
src/test/regress/expected/for_portion_of.out
src/test/regress/sql/for_portion_of.sql