Re: UNIQUE INDEX unaware of transactions (a spin ofquestion) - Mailing list pgsql-hackers

From Hannu Krosing
Subject Re: UNIQUE INDEX unaware of transactions (a spin ofquestion)
Date
Msg-id 3B2DD6D0.3D16636@tm.ee
Whole thread Raw
In response to Re: UNIQUE INDEX unaware of transactions (a spin of question)  (Peter Eisentraut <peter_e@gmx.net>)
Responses Re: UNIQUE INDEX unaware of transactions (a spin ofquestion)
List pgsql-hackers
Peter Eisentraut wrote:
> 
> Jarmo Paavilainen writes:
> 
> > *I think* this is correct behaviour, ie all that one transaction does should
> > be visible to other transactions.
> 
> Only in the "read uncommitted" transaction isolation level, which
> PostgreSQL does not provide and isn't really that useful.
> 

...

> 
> You can try yourself how PostgreSQL handles this, which is probably not
> the right thing since unique contraints are not correctly transaction
> aware.

Is there any way to make unique indexes transaction-aware ?

Are competeing updates on unique indexes transaction-aware ?

I.e. can I be sure that if I do 

begin;
if select where key=1 result exists
then update where key=1
else insert(key,...)values(1,...)
end;

then this will have the expected behaviour in presence of multiple 
concurrent updaters?

------------------
Hannu


pgsql-hackers by date:

Previous
From: Oleg Bartunov
Date:
Subject: initdb from current cvs failed
Next
From: Hannu Krosing
Date:
Subject: Re: Update on Access 97 and = NULL