graphql-engine icon indicating copy to clipboard operation
graphql-engine copied to clipboard

Insert into Postgres Partitioned Table Fails -SQL Error [0A000]: ERROR: cannot retrieve a system column in this context

Open IS-Josh opened this issue 2 years ago • 2 comments

Version Information

Server Version: CLI Version (for CLI related issue):[v2.25.1-ce]

Environment

GCP Cloud Run

What is the current behaviour?

Mutation Fails when inserting into partitioned table

What is the expected behaviour?

insert should work issue appears due to the returning clause containing xmax, when removed the following error goes away

SQL Error [0A000]: ERROR: cannot retrieve a system column in this context

returning * , case when ("xx"."xxx"."xmax") = (0) then ('true')::boolean else ((((("xx"."xxx"."xxxx") = (('00000000-0000-0000-0000-000000000000')::uuid)) or ((("xx"."xxx"."xxxx") is null) and ((('00000000-0000-0000-0000-000000000000')::uuid) is null))) and ('true')) and ('true'))::boolean end as "check__constraint")

How to reproduce the issue?

1.Create a partitioned table with a unique constraint 2.Insert data 3.

Screenshots or Screencast

Please provide any traces or logs that could help here.

Any possible solutions/workarounds you're aware of?

Keywords

IS-Josh avatar Jun 19 '23 06:06 IS-Josh

Hi,

Do you happen to have any update on this one?

debarisi avatar Feb 11 '24 15:02 debarisi

I have managed to reproduce the issue on Postgresql v16. Steps to reproduce

  1. Create a partitioned table
  2. Insert row with the statement 'returning xmin'

Best,

debarisi avatar Feb 11 '24 15:02 debarisi