cockroachdb / cockroachdb/cockroach
QA: sql: copy to stdout doesn't require returning clause for insert
Open
C-bug
O-qa
T-sql-queries
- Dominant language
- Go
- Stars
- 32.5k
- Forks
- 4.1k
- PR merge metrics
- PR metrics pending
Description
**Describe the problem**
From the postgres docs for Copy:
>For INSERT, UPDATE and DELETE queries a RETURNING clause must be provided...
In CRDB `COPY TO STDOUT` does not require mutations to have a RETURNING clause as expected, and instead will silently return no results for a mutation without RETURNING.
**To Reproduce**
```
CREATE TABLE xy (x INT, y INT);
COPY (INSERT INTO xy VALUES (1, 1), (2, 2), (3, 3)) TO STDOUT (DELIMITER '|');
```
Expected:
```
ERROR: COPY query must have a RETURNING clause
```
Actual (empty result):
```
```
Jira issue: CRDB-26465
Contributor guide
Assessment
This issue has not been assessed yet.