Re: PostgreSQL transaction locking problem

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
Cc: jeff(at)dgjc(dot)org, pgsql-general(at)postgresql(dot)org
Subject: Re: PostgreSQL transaction locking problem
Date: 2002-02-02 20:40:53
Message-ID: 18738.1012682453@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2002-02-02 20:57:19 Re: Preformance
Previous Message Stephan Szabo 2002-02-02 19:27:37 Re: PostgreSQL transaction locking problem