Re: Allow ON CONFLICT DO UPDATE to return EXCLUDED values

From: Vik Fearing <vik(at)postgresfriends(dot)org>
To: Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com>, Viktor Holmberg <v(at)viktorh(dot)net>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Allow ON CONFLICT DO UPDATE to return EXCLUDED values
Date: 2025-10-08 09:20:48
Message-ID: 1d4b3d42-ccdc-4555-b4df-268d6daf97a5@postgresfriends.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


On 07/10/2025 23:52, Dean Rasheed wrote:
> On Tue, 7 Oct 2025 at 14:56, Viktor Holmberg <v(at)viktorh(dot)net> wrote:
>> A maybe bigger question, is it nice that EXCLUDED is null when no conflict occurred? I can see the logic, but I think ergonomics wise it’d be nicer to have the proposed values in EXCLUDED, no matter what happened later. Then one can check EXCLUDED.value = NEW.value to see if one’s changes were added, for example.
> Hmm, I'm not sure. I think it would be counter-intuitive to have
> non-null EXCLUDED values for rows that weren't excluded, and I think
> it's just as easy to check what values were added either way.

Agreed.  EXCLUDED should be null or even inaccessible if the row wasn't
excluded.

--

Vik Fearing

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2025-10-08 09:45:33 Re: Logical Replication of sequences
Previous Message Dilip Kumar 2025-10-08 09:11:27 Re: Logical Replication of sequences