pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Fix system column accesses in ON CONFLICT ... RETURNING.
2+ messages / 1 participants
[nested] [flat]

* pgsql: Fix system column accesses in ON CONFLICT ... RETURNING.
@ 2019-07-25 01:54 Andres Freund <andres@anarazel.de>
  0 siblings, 0 replies; 2+ messages in thread

From: Andres Freund @ 2019-07-25 01:54 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/ecbdd009344d3a00733e4382f50137b5e0248ce8

Modified Files
--------------
src/backend/executor/nodeModifyTable.c |  9 +++++++--
src/test/regress/expected/update.out   | 23 +++++++++++++++++++++++
src/test/regress/sql/update.sql        | 15 +++++++++++++++
3 files changed, 45 insertions(+), 2 deletions(-)



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* pgsql: Fix system column accesses in ON CONFLICT ... RETURNING.
@ 2019-07-25 01:54 Andres Freund <andres@anarazel.de>
  0 siblings, 0 replies; 2+ messages in thread

From: Andres Freund @ 2019-07-25 01:54 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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

Branch
------
REL_12_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/f9257cffef3bb16aba2dbbe05fd8bf0afaa6b1f2

Modified Files
--------------
src/backend/executor/nodeModifyTable.c |  9 +++++++--
src/test/regress/expected/update.out   | 23 +++++++++++++++++++++++
src/test/regress/sql/update.sql        | 15 +++++++++++++++
3 files changed, 45 insertions(+), 2 deletions(-)



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2019-07-25 01:54 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2019-07-25 01:54 pgsql: Fix system column accesses in ON CONFLICT ... RETURNING. Andres Freund <andres@anarazel.de>
2019-07-25 01:54 pgsql: Fix system column accesses in ON CONFLICT ... RETURNING. Andres Freund <andres@anarazel.de>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox