Re: Allow ON CONFLICT DO UPDATE to return EXCLUDED values

From: Jim Jones <jim(dot)jones(at)uni-muenster(dot)de>
To: Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Allow ON CONFLICT DO UPDATE to return EXCLUDED values
Date: 2025-07-07 18:09:31
Message-ID: b761b218-595f-428f-aeeb-6280e5e16af0@uni-muenster.de
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


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.

Best, Jim

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2025-07-07 18:36:53 Re: [PATCH] Allow parallelism for plpgsql return expression after commit 556f7b7
Previous Message Tom Lane 2025-07-07 17:52:56 Re: A recent message added to pg_upgade