citusdata / citusdata/citus

Improve error messages on UPDATE .. RETURNING (Subquery)

Open
#6,651 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
12.8k
Forks
794
Avg merge
2d 14h
Merged PRs (30d)
31

Description

Currently we do not support having arbitrary subqueries in RETURNING clauses of an UPDATE query. If this subquery does not access the updated table, we see weird errors:

```
UPDATE ref SET a = 1 RETURNING
(SELECT pg_catalog.max(latest_end_time) FROM pg_catalog.pg_stat_wal_receiver)
as c3;
ERROR: a column definition list is required for functions returning "record"
```

similarly:

```
create table t1 (a int);
select create_reference_table('t1');
update t1 set a = 1 returning
(select pg_catalog.max(wal_bytes) from pg_catalog.pg_stat_wal)
as c3;
ERROR: input of anonymous composite types is not implemented
```

See: #6634

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.