Re: On duplicate ignore

From: Florian Weimer <fweimer(at)bfk(dot)de>
To: <gnanam(at)zoniac(dot)com>
Cc: "'Atul Goel'" <Atul(dot)Goel(at)iggroup(dot)com>, <pgsql-general(at)postgresql(dot)org>
Subject: Re: On duplicate ignore
Date: 2012-01-19 14:54:29
Message-ID: 82lip3agka.fsf@mid.bfk.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)bfk(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Ingmar Brouns 2012-01-19 15:56:32 variadic array arguments, can it work?
Previous Message Volodymyr Kostyrko 2012-01-19 08:53:47 Re: scenario with a slow query