Re: UNIQUE INDEX unaware of transactions

From: Doug McNaught <doug(at)wireboard(dot)com>
To: Hannu Krosing <hannu(at)tm(dot)ee>
Cc: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: UNIQUE INDEX unaware of transactions
Date: 2001-06-15 15:40:41
Message-ID: m366dxlpja.fsf@belphigor.mcnaught.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hannu Krosing <hannu(at)tm(dot)ee> writes:

> It seems that our current way of enforcing uniqueness knows nothing
> about transactions ;(
>
> when you
>
> create table t(
> i int4 primary key
> );"""
>
> and then run the following query
>
> begin;
> delete from t where i=1;
> insert into t(i) values(1);
> end;
>
> in a loop from two parallel processes in a loop then one of them will
> almost instantaneously err out with
>
> ERROR: Cannot insert a duplicate key into unique index t_pkey

Have you tried running this test with transaction isolation set to
SERIALIZABLE?

-Doug
--
The rain man gave me two cures; he said jump right in,
The first was Texas medicine--the second was just railroad gin,
And like a fool I mixed them, and it strangled up my mind,
Now people just get uglier, and I got no sense of time... --Dylan

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Dave Cramer 2001-06-15 15:50:32 Re: RE: Row Versioning, for jdbc updateable result sets
Previous Message Michael Meskes 2001-06-15 15:28:54 Re: NOTICE messages