Re: BUG #19081: Inconsistent target rows seen by the UPDATE and INSERT statements within the same transaction - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #19081: Inconsistent target rows seen by the UPDATE and INSERT statements within the same transaction
Date
Msg-id 3080220.1760030272@sss.pgh.pa.us
Whole thread Raw
In response to BUG #19081: Inconsistent target rows seen by the UPDATE and INSERT statements within the same transaction  (PG Bug reporting form <noreply@postgresql.org>)
Responses Re: BUG #19081: Inconsistent target rows seen by the UPDATE and INSERT statements within the same transaction
List pgsql-bugs
PG Bug reporting form <noreply@postgresql.org> writes:
> After transaction 1 was committed, the second INSERT in transaction 2
> successfully inserted the value (0, 12) because transaction 1 had updated
> the row (0, 0). However, the UPDATE in transaction 2 did not update the row
> (5, 5) that were updated in transaction 1.
> The final database result seems to indicate that the second INSERT in
> transaction 2 can see the update made by transaction 1, but the UPDATE in
> transaction 2 cannot see the update made by transaction 1. Why do these two
> statements show different effects when exposed to the influence of
> transaction 1?

I don't see any particular contradiction here.  At the time of T2's
second INSERT, the removal of the original (0, 0) row has already
committed, so there is no reason to disallow that INSERT.

REPEATABLE READ does not intend to promise no serialization anomalies.
SERIALIZABLE mode is a better approximation to that if you need it,
though it has its own downsides.

            regards, tom lane



pgsql-bugs by date:

Previous
From: Jeff Davis
Date:
Subject: Re: BUG #19078: Segfaults in tts_minimal_store_tuple() following pg_upgrade
Next
From: Zane Duffield
Date:
Subject: Date/Time parsing of ISO 8601 timestamps with commas