Re: BUG #19355: Attempt to insert data unexpectedly during concurrent update

From: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
To: wangbihua(dot)cn(at)gmail(dot)com, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #19355: Attempt to insert data unexpectedly during concurrent update
Date: 2025-12-15 06:25:18
Message-ID: 868ff2a518820c8864b6d28510294b2457a126af.camel@cybertec.at
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Mon, 2025-12-15 at 01:40 +0000, PG Bug reporting form wrote:
> Start two transaction and update on same tuple, raise concurrent update and
> evalplanqual.  It will be found out that the session with evalplanqual did
> not successfully update the data, but instead attempted to insert a row of
> data incorrectly.

I'd say that is expected.

If you need a guarantee that either INSERT or UPDATE succeed, you have to use
INSERT ... ON CONFLICT ... DO UPDATE

Yours,
Laurenz Albe

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Richard Guo 2025-12-15 14:28:54 Re: BUG #19353: Error XX000 if referencing expanded array in grouping set: variable not found in subplan target list
Previous Message PG Bug reporting form 2025-12-15 01:40:55 BUG #19355: Attempt to insert data unexpectedly during concurrent update