ERROR: virtual tuple table slot does not have system attributes

Roby <pacman@finefun.com.au>

From: Roby <pacman@finefun.com.au>
To: pgsql-bugs@lists.postgresql.org
Date: 2019-06-28T03:31:14Z
Lists: pgsql-bugs
Hi,

Thank you all very much for your work on Postgres.

I have encountered the following error in 12b2 in code that has been working fine for a while in version 11.

A test script is attached, the output of which follows.




> DROP TABLE
> DROP FUNCTION
> CREATE TABLE
> CREATE FUNCTION
>  test_upsert 
> -------------
>            1
> (1 row)
> 
>  test_upsert 
> -------------
>            0
> (1 row)
> 
> psql:test.sql:29: ERROR:  virtual tuple table slot does not have system attributes
> CONTEXT:  SQL function "test_upsert" statement 1



Regards,
Rob.

Commits

  1. Fix system column accesses in ON CONFLICT ... RETURNING.

  2. Don't reuse slots between root and partition in ON CONFLICT ... UPDATE.