Re: On duplicate ignore - Mailing list pgsql-general

From Florian Weimer
Subject Re: On duplicate ignore
Date
Msg-id 82lip3agka.fsf@mid.bfk.de
Whole thread Raw
In response to Re: On duplicate ignore  ("Gnanakumar" <gnanam@zoniac.com>)
Responses Re: On duplicate ignore  (Scott Marlowe <scott.marlowe@gmail.com>)
Re: On duplicate ignore  (Lincoln Yeoh <lyeoh@pop.jaring.my>)
List pgsql-general
* Gnanakumar:

>> Just create a unique index on EMAIL column and handle error if it comes
>
> Thanks for your suggestion.  Of course, I do understand that this could be
> enforced/imposed at the database-level at any time.  But I'm trying to find
> out whether this could be solved at the application layer itself.  Any
> thoughts/ideas?

If you use serializable transactions in PostgreSQL 9.1, you can
implement such constraints in the application without additional
locking.  However, with concurrent writes and without an index, the rate
of detected serialization violations and resulting transactions aborts
will be high.

--
Florian Weimer                <fweimer@bfk.de>
BFK edv-consulting GmbH       http://www.bfk.de/
Kriegsstraße 100              tel: +49-721-96201-1
D-76133 Karlsruhe             fax: +49-721-96201-99

pgsql-general by date:

Previous
From: Volodymyr Kostyrko
Date:
Subject: Re: scenario with a slow query
Next
From: Ingmar Brouns
Date:
Subject: variadic array arguments, can it work?