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