Number of rows for insert..select..on conflict via coordinator is incorrect
- Dominant language
- C
- Stars
- 12.8k
- Forks
- 794
- Avg merge
- 2d 14h
- Merged PRs (30d)
- 31
Description
When doing an INSERT..SELECT .. ON CONFLICT DO NOTHING via the coordinator, the number of rows reported in the completion tag is incorrect. It should indicate the number of rows that were modified, which in the below example is 0.
```sql
postgres=# CREATE TABLE t (x int primary key);
CREATE TABLE
postgres=# INSERT INTO t SELECT s FROM generate_series(1,10) s ON CONFLICT DO NOTHING;
INSERT 0 10
postgres=# INSERT INTO t SELECT s FROM generate_series(1,10) s ON CONFLICT DO NOTHING;
INSERT 0 0
postgres=# SELECT create_distributed_table('t','x');
NOTICE: Copying data from local table...
┌──────────────────────────┐
│ create_distributed_table │
├──────────────────────────┤
│ │
└──────────────────────────┘
(1 row)
postgres=# INSERT INTO t SELECT s FROM generate_series(1,10) s ON CONFLICT DO NOTHING;
INSERT 0 10
```
Contributor guide
Assessment
This issue has not been assessed yet.