pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Vik Fearing <vik@postgresfriends.org>
To: Dean Rasheed <dean.a.rasheed@gmail.com>
To: Viktor Holmberg <v@viktorh.net>
Cc: pgsql-hackers@postgresql.org
Subject: Re: Allow ON CONFLICT DO UPDATE to return EXCLUDED values
Date: Wed, 8 Oct 2025 11:20:48 +0200
Message-ID: <1d4b3d42-ccdc-4555-b4df-268d6daf97a5@postgresfriends.org> (raw)
In-Reply-To: <CAEZATCUvXZ=Tyrc_spwE4mVSfz9aLeYtQo1+YdR4zr1UA7Wa4A@mail.gmail.com>
References: <fb18cbb9-32ca-46ea-b2ff-a7e7f20e883c@Spark>
	<CAEZATCUvXZ=Tyrc_spwE4mVSfz9aLeYtQo1+YdR4zr1UA7Wa4A@mail.gmail.com>


On 07/10/2025 23:52, Dean Rasheed wrote:
> On Tue, 7 Oct 2025 at 14:56, Viktor Holmberg <v@viktorh.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






view thread (17+ messages)  latest in thread

Message-ID: <1d4b3d42-ccdc-4555-b4df-268d6daf97a5@postgresfriends.org>
Permalink:  ../1d4b3d42-ccdc-4555-b4df-268d6daf97a5@postgresfriends.org/
Also on:    postgresql.org/message-id/1d4b3d42-ccdc-4555-b4df-268d6daf97a5@postgresfriends.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-hackers@postgresql.org
  Cc: vik@postgresfriends.org, dean.a.rasheed@gmail.com, v@viktorh.net
  Subject: Re: Allow ON CONFLICT DO UPDATE to return EXCLUDED values
  In-Reply-To: <1d4b3d42-ccdc-4555-b4df-268d6daf97a5@postgresfriends.org>
  References: <fb18cbb9-32ca-46ea-b2ff-a7e7f20e883c@Spark> <CAEZATCUvXZ=Tyrc_spwE4mVSfz9aLeYtQo1+YdR4zr1UA7Wa4A@mail.gmail.com> <1d4b3d42-ccdc-4555-b4df-268d6daf97a5@postgresfriends.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox