Re: BUG #19355: Attempt to insert data unexpectedly during concurrent update - Mailing list pgsql-bugs

From Laurenz Albe
Subject Re: BUG #19355: Attempt to insert data unexpectedly during concurrent update
Date
Msg-id 868ff2a518820c8864b6d28510294b2457a126af.camel@cybertec.at
Whole thread Raw
In response to BUG #19355: Attempt to insert data unexpectedly during concurrent update  (PG Bug reporting form <noreply@postgresql.org>)
List 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



pgsql-bugs by date:

Previous
From: PG Bug reporting form
Date:
Subject: BUG #19355: Attempt to insert data unexpectedly during concurrent update
Next
From: Robert Haas
Date:
Subject: Re: Cluster is not being created