| From: | Jim Jones <jim(dot)jones(at)uni-muenster(dot)de> |
|---|---|
| To: | Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org> |
| Subject: | Re: Allow ON CONFLICT DO UPDATE to return EXCLUDED values |
| Date: | 2025-07-07 10:38:21 |
| Message-ID: | 8c0bbad5-2051-45f7-83cc-2047f7c58ba1@uni-muenster.de |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
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
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Chiranmoy.Bhattacharya@fujitsu.com | 2025-07-07 10:41:52 | Re: [PATCH] Hex-coding optimizations using SVE on ARM. |
| Previous Message | Zhijie Hou (Fujitsu) | 2025-07-07 10:31:25 | RE: Conflict detection for update_deleted in logical replication |