Re: Allow ON CONFLICT DO UPDATE to return EXCLUDED values - Mailing list pgsql-hackers

From Dean Rasheed
Subject Re: Allow ON CONFLICT DO UPDATE to return EXCLUDED values
Date
Msg-id CAEZATCUVjmVAwJ8SXb7CP4k1gN9yWd7bDUrJVwOoCLbq6FiRPg@mail.gmail.com
Whole thread Raw
In response to Re: Allow ON CONFLICT DO UPDATE to return EXCLUDED values  (Dean Rasheed <dean.a.rasheed@gmail.com>)
List pgsql-hackers
On Mon, 7 Jul 2025 at 19:09, Jim Jones <jim.jones@uni-muenster.de> wrote:
>
> On 07.07.25 19:52, Dean Rasheed wrote:
> > perhaps that should say
> >
> >     Note that any values that were supplied by defaults, as well as
> >     the effects of all per-row BEFORE INSERT triggers are reflected
> >     in excluded values, since that may have contributed to the row
> >     being excluded from insertion.
>
> +1
>
> IMO a short mention at insert.sgml also wouldn't hurt, e.g.
>
> If the INSERT has an ON CONFLICT DO UPDATE clause, a column name or *
> may be qualified using EXCLUDED to return the values that would have
> been inserted. These values include any DEFAULT expressions or computed
> expressions from the INSERT clause. If there is no conflict, then all
> EXCLUDED values will be NULL.

Thanks. I like some of this text better than what I originally wrote.
However, I don't like repeating different fragments of information in
different places on the same page. I think it's better to have a
single place on that page that describes all the properties of the
special excluded table, and then refer to that. In the attached v3,
I've done that in the form of a <note>, which makes it stand out more,
and is easier to refer to.

Regards,
Dean

Attachment

pgsql-hackers by date:

Previous
From: Amit Kapila
Date:
Subject: Re: Conflict detection for update_deleted in logical replication
Next
From: Dilip Kumar
Date:
Subject: Re: A recent message added to pg_upgade