Re: INSERT ... ON CONFLICT DO SELECT [FOR ...] take 2

Viktor Holmberg <v@viktorh.net>

From: "v@viktorh.net" <v@viktorh.net>
To: pgsql-hackers <pgsql-hackers@postgresql.org>
Cc: Andreas Karlsson <andreas@proxel.se>
Date: 2025-09-02T18:56:31Z
Lists: pgsql-hackers

Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Add support for INSERT ... ON CONFLICT DO SELECT.

Hello, I was working on my own patch for the same thing, until I found this was already there. 
I think this would be very useful for a lot of people.
Do you need any help moving this forward Anderas? I have both tests and docs written, although not for the FOR UPDATE part.

> On 25 Jun 2025, at 13:39, Dean Rasheed <dean.a.rasheed@gmail.com> wrote:
> 
> On Mon, 12 May 2025 at 19:33, Andreas Karlsson <andreas@proxel.se> wrote:
>> 
>> I have fixed that one and some other issues locally and will submit a
>> new version in a while after I have added more tests because you are
>> very correct in that a big issue with my last version of the patch was
>> the big lack of tests and lack of making sure all features which
>> interact with UPSERT actually worked with my changes. Plus some islation
>> tests would be nice to have.
>> 
> 
> +1. Don't forget to move the CF entry to the next open CF.
> 
> FYI, over on [1] I proposed more tests and doc updates for RLS. I
> think those updates might make it easier to test and document the RLS
> aspects of this patch.
> 
> [1] https://www.postgresql.org/message-id/flat/CAEZATCWqnfeChjK=n1V_dYZT4rt4mnq+ybf9c0qXDYTVMsy8pg@mail.gmail.com
> 
> Regards,
> Dean
> 
> 
>