pg_pathman icon indicating copy to clipboard operation
pg_pathman copied to clipboard

ON CONFLICT clause is not supported with partitioned tables

Open farons opened this issue 5 years ago • 0 comments

postgres 12.5 An error occurred when I tried to use upsert to update my main table; but when I use the traditional way: CREATE TABLE o(id INT PRIMARY KEY, i INT) PARTITION BY RANGE (id); CREATE TABLE o1 PARTITION OF o FOR VALUES FROM (1) TO (1000); CREATE TABLE o2 PARTITION OF o FOR VALUES FROM (1000) TO (2000);

INSERT INTO o(id, i) VALUES (1,1),(2,2),(1500,1500);

INSERT INTO o(id, i) VALUES (1500, 1400), (2,20), (3, 3) ON CONFLICT (id) DO UPDATE SET i = EXCLUDED.i; it is ok. why?

farons avatar Dec 14 '20 06:12 farons