Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1v68Af-00HKPB-6h for pgsql-hackers@arkaria.postgresql.org; Tue, 07 Oct 2025 13:56:05 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1v68Ac-000531-30 for pgsql-hackers@arkaria.postgresql.org; Tue, 07 Oct 2025 13:56:03 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1v68Ab-000527-OL for pgsql-hackers@lists.postgresql.org; Tue, 07 Oct 2025 13:56:02 +0000 Received: from out-02.pe-bsn.jellyfish.systems ([66.29.159.80]) by makus.postgresql.org with smtp (Exim 4.96) (envelope-from ) id 1v68AZ-000VE0-2H for pgsql-hackers@postgresql.org; Tue, 07 Oct 2025 13:56:01 +0000 Received: from MTA-09.privateemail.com (unknown [10.50.14.19]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by BSN-01.privateemail.com (Postfix) with ESMTPS id 4cgyMy40NKz3hhTj for ; Tue, 7 Oct 2025 09:55:58 -0400 (EDT) Received: from mta-09.privateemail.com (localhost [127.0.0.1]) by mta-09.privateemail.com (Postfix) with ESMTP id 4cgyMy2nmnz3hhTl for ; Tue, 7 Oct 2025 09:55:58 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=viktorh.net; s=default; t=1759845358; bh=pnQ3HcvaeQYL0+2eevvoyDZtSjwQF1xpCECHIzvBVt8=; h=Date:From:To:Subject:From; b=Dnsqfv/oH6nSveKgjuAkCIztgu9+S44VyiUfDfL7TXoRnqMlRnI811Z1xSMoVG/35 9E0xwsOp/Z0Mp/fcauiARlli1SjzI7BHoFQgulzCNDQiOLxp4q0XLklkWhXU8LtQfb +wmQ69nkQTmpRlU4NRj52FG4+RPPdCAxJ2Aa7pbEv5yMwY3rbxEDS1J8n+nF1dwU4q VXTkH9dhr8qxl58bbMlpXyN9KJ6XdAicTm7q/C47MYCHKlj1OcDxPLsGJUgQYuDh6b krtuuF45x2Q9V8T2coVCK77QwObPB5uhsFCgpfZknGHFzgo3Pwv8QeX724BxgiNMwk sph6fIeFmVZEg== Received: from [192.168.0.121] (c188-151-222-15.bredband.tele2.se [188.151.222.15]) by mta-09.privateemail.com (Postfix) with ESMTPA for ; Tue, 7 Oct 2025 09:55:57 -0400 (EDT) Date: Tue, 7 Oct 2025 15:55:49 +0200 From: Viktor Holmberg To: pgsql-hackers@postgresql.org Message-ID: Subject: Re: Allow ON CONFLICT DO UPDATE to return EXCLUDED values X-Readdle-Message-ID: fb18cbb9-32ca-46ea-b2ff-a7e7f20e883c@Spark MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="68e51bea_ec48014_55b" X-Virus-Scanned: ClamAV using ClamSMTP List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --68e51bea_ec48014_55b Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline I=E2=80=99ve looked through this patch. As far as I can tell, everything = looks good, working and well commented. The only nitpick I could find is a mispelling=C2=A0=22EXLCUDED=22 =E2=86=92= =22EXCLUDED=22 in src/test/regress/expected/returning.out:464. A maybe bigger question, is it nice that EXCLUDED is null when no conflic= t occurred=3F I can see the logic, but I think ergonomics wise it=E2=80=99= d be nicer to have the proposed values in EXCLUDED, no matter what happen= ed later. Then one can check EXCLUDED.value =3D NEW.value to see if one=E2= =80=99s changes were added, for example. /Viktor On 7 Oct 2025 at 15:43 +0200, Dean Rasheed , = wrote: > Rebased version attached, following 904f6a593a0. > > Regards, > Dean --68e51bea_ec48014_55b Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline
I=E2=80=99= ve looked through this patch. As far as I can tell, everything looks good= , working and well commented.
The only nitpick I could find i= s a mispelling&=23160;=22EXLCUDED=22 =E2=86=92 =22EXCLUDED=22 in s= rc/test/regress/expected/returning.out:464.

A maybe bigger question, is it nice that EXCLUDED is null when no conflic= t occurred=3F I can see the logic, but I think ergonomics wise it=E2=80=99= d be nicer to have the proposed values in EXCLUDED, no matter what happen= ed later. Then one can check EXCLUDED.value =3D NEW.value to see if one=E2= =80=99s changes were added, for example.

/Viktor
On 7 Oct 2025 at 15:43 +0200, Dean = Rasheed <dean.a.rasheed=40gmail.com>, wrote:
Rebased version attached, following 904f6a593a0.

Regards,
Dean
--68e51bea_ec48014_55b--