Insert into Postgres Partitioned Table Fails -SQL Error [0A000]: ERROR: cannot retrieve a system column in this context
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
Hi,
Do you happen to have any update on this one?
I have managed to reproduce the issue on Postgresql v16. Steps to reproduce
- Create a partitioned table
- Insert row with the statement 'returning xmin'
Best,