Hi Dean
On 30.06.25 19:18, Dean Rasheed wrote:
> v2 attached, now with docs and more test cases.
I'm wondering if the current behaviour with DEFAULT columns should be
mentioned in the docs.
CREATE TABLE t2 (a int PRIMARY KEY, b text DEFAULT 'default value');
INSERT INTO t2 VALUES (1, 'old value');
INSERT INTO t2 VALUES (1)
ON CONFLICT (a) DO UPDATE SET b = 'new value'
RETURNING a, old.b, new.b, excluded.b;
CREATE TABLE
INSERT 0 1
a | b | b | b
---+-----------+-----------+---------------
1 | old value | new value | default value
(1 row)
While it may seem intuitive, it's possible that it could cause confusion
for some users.
Best, Jim