Re: On duplicate ignore

Поиск
Список
Период
Сортировка
От Dmitriy Igrishin
Тема Re: On duplicate ignore
Дата
Msg-id CAAfz9KPoK5B=NCKKCmbH6KJcgr7jtvZDxaU4r-HPg9eXhcfX1w@mail.gmail.com
обсуждение исходный текст
Ответ на Re: On duplicate ignore  ("Gnanakumar" <gnanam@zoniac.com>)
Список pgsql-general
Hey Gnanakumar,

2012/1/18 Gnanakumar <gnanam@zoniac.com>
> 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?
Exactly at the application level you just need to ignore
an unique constraint violation error reported by the backend.
You may also wrap INSERT statement in the PL/pgSQL
function or in the DO statement and catch the exception
generated by the backend.

// Dmitriy.


В списке pgsql-general по дате отправления:

Предыдущее
От: "Gnanakumar"
Дата:
Сообщение: Re: On duplicate ignore
Следующее
От: salah jubeh
Дата:
Сообщение: Table permessions