hasura / hasura/graphql-engine

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

Open
#9,719 2 comments 0 reactions 0 assignees View on GitHub
k/bug
Dominant language
TypeScript
Stars
32.1k
Forks
3k
PR merge metrics
PR metrics pending

Description

### 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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.