]> granicus.if.org Git - postgresql/commit
Fix system column accesses in ON CONFLICT ... RETURNING.
authorAndres Freund <andres@anarazel.de>
Thu, 25 Jul 2019 01:45:58 +0000 (18:45 -0700)
committerAndres Freund <andres@anarazel.de>
Thu, 25 Jul 2019 01:46:20 +0000 (18:46 -0700)
commitf9257cffef3bb16aba2dbbe05fd8bf0afaa6b1f2
treec8c68d5e171b4e183f1d755f7c96f02c391ec5d6
parent24a6b6af650132094f7f8547458a3835cf01be7f
Fix system column accesses in ON CONFLICT ... RETURNING.

After 277cb789836 ON CONFLICT ... SET ... RETURNING failed with
ERROR:  virtual tuple table slot does not have system attributes
when taking the update path, as the slot used to insert into the
table (and then process RETURNING) was defined to be a virtual slot in
that commit. Virtual slots don't support system columns except for
tableoid and ctid, as the other system columns are AM dependent.

Fix that by using a slot of the table's type. Add tests for system
column accesses in ON CONFLICT ...  RETURNING.

Reported-By: Roby, bisected to the relevant commit by Jeff Janes
Author: Andres Freund
Discussion: https://postgr.es/m/73436355-6432-49B1-92ED-1FE4F7E7E100@finefun.com.au
Backpatch: 12-, where the bug was introduced in 277cb789836
src/backend/executor/nodeModifyTable.c
src/test/regress/expected/update.out
src/test/regress/sql/update.sql