RE: Revisited: Transactions, insert unique.

From: "Hiroshi Inoue" <Inoue(at)tpf(dot)co(dot)jp>
To: "Joachim Achtzehnter" <joachim(at)kraut(dot)bc(dot)ca>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: RE: Revisited: Transactions, insert unique.
Date: 2000-04-26 06:55:15
Message-ID: 000201bfaf4c$603aba20$2801007e@tpf.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> -----Original Message-----
> From: pgsql-general-owner(at)hub(dot)org [mailto:pgsql-general-owner(at)hub(dot)org]On
> Behalf Of Joachim Achtzehnter
>
> In a message to Ed Loehr and pgsql-general, Lincoln Yeoh wrote:
> >
> > Transaction A
> > begin;
> > insert into test (a,b) select 4,'four' from test
> > where not exists (select * from test where a=4);
> >
> > Transaction B
> > begin;
> > insert into test (a,b) select 4,'four' from test
> > where not exists (select * from test where a=4);
> >
> > Then you do a commit on both, and you end up with two rows.
>
> This is dissapointing indeed! What this means is that Postgresql
> transactions are, in fact, not truely serializable. The concurrent
> execution of these two transactions is not equivalent to some serial
> execution.
>

Strictly speaking SERIALIZABLE isolation level of PosgreSQL isn't
SERIALIZABLE. It's same as Oracle.
AFAIK,there's no way to block (logically) non-existent row(key)
except unique constraint.

Regards.

Hiroshi Inoue
Inoue(at)tpf(dot)co(dot)jp

P.S. Note that the default isolation level of PostgreSQL is READ
COMMITTED.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Joachim Achtzehnter 2000-04-26 07:18:23 RE: Revisited: Transactions, insert unique.
Previous Message Oliver Elphick 2000-04-26 06:10:01 Re: Having trouble getting readline functional in psql