Re: PostgreSQL transaction locking problem - Mailing list pgsql-general

From Tom Lane
Subject Re: PostgreSQL transaction locking problem
Date
Msg-id 18738.1012682453@sss.pgh.pa.us
Whole thread Raw
In response to Re: PostgreSQL transaction locking problem  (Stephan Szabo <sszabo@megazone23.bigpanda.com>)
Responses Re: PostgreSQL transaction locking problem
List pgsql-general
Stephan Szabo <sszabo@megazone23.bigpanda.com> writes:
> I actually thought that he's complaining about the fact that it gives him
> the same id twice if he runs it in two transactions rather than the delay
> until the first commits.

As written, he gets a delay (because of the LOCK) *and* duplicate IDs
(because with the serializable isolation level, the second xact can't
see the row inserted by the first, even after waiting for it to commit).
Worst of both worlds.

There's a reason why we provide sequences as primitive objects: you
can't build an equivalent behavior very easily under MVCC rules.

            regards, tom lane

pgsql-general by date:

Previous
From: Stephan Szabo
Date:
Subject: Re: PostgreSQL transaction locking problem
Next
From: Tom Lane
Date:
Subject: Re: Preformance