Improve error messages on UPDATE .. RETURNING (Subquery)
Open
- 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
Assessment
This issue has not been assessed yet.