> -----Original Message-----
> From: pgsql-general-owner@hub.org [mailto:pgsql-general-owner@hub.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@tpf.co.jp
P.S. Note that the default isolation level of PostgreSQL is READ
COMMITTED.