wrongly raised syntax error with INSERT ... VALUES(DEFAULT)
- Dominant language
- C
- Stars
- 12.8k
- Forks
- 794
- Avg merge
- 2d 14h
- Merged PRs (30d)
- 31
Description
```
CREATE TABLE t0(c0 int);
SELECT create_reference_table('t0');
INSERT INTO t0(c0) OVERRIDING SYSTEM VALUE VALUES(DEFAULT);
ERROR: syntax error at or near "DEFAULT"
```
While the INSERT command above runs on local tables, it raises an error in reference tables. The error occurs when the INSERT command is made with no DEFAULT value defined, and there is a preceding "OVERRIDING SYSTEM VALUE". This causes the command sent to worker nodes to have wrong syntax. I have attached log outputs of the commands sent to workers both in the case where "OVERRIDING SYSTEM VALUES" is omitted and included, for comparison.
The expected behavior mimicking a local table would be to add an empty row in this case, since no DEFAULT value was defined while creating the table.
[defaultbug output.txt](https://github.com/citusdata/citus/files/4902837/defaultbug.output.txt)
Contributor guide
Assessment
This issue has not been assessed yet.