oguimbal / pg-mem

An in memory postgres DB instance for your unit tests

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

INSERT w/ ON CONFLICT DO NOTHING RETURNING * is returning rows for ignored conflicts

will-path opened this issue · comments

commented

Describe the bug

In Postgres, when you combine ON CONFLICT DO NOTHING with RETURNING, the conflicting rows are not returned.

To Reproduce

CREATE TABLE example (id bigint PRIMARY KEY);
INSERT INTO example (id) VALUES (1) RETURNING *;
-- id: 1
INSERT INTO example (id) VALUES (1) ON CONFLICT DO NOTHING RETURNING *;
-- id: 1 (WRONG)

pg-mem version

2.6.13