Istnieje sposób bez dodawania kolumny do tabeli:
CREATE TABLE tbl(id int PRIMARY KEY, col int);
INSERT INTO tbl VALUES (1, 1);
INSERT INTO tbl(id, col)
VALUES (1,11), (2,22)
ON CONFLICT (id) DO UPDATE
SET col = EXCLUDED.col
RETURNING *, (xmax = 0) AS inserted;
Wyjaśnienie: