Re: duplicate key violates unique constraint

Поиск
Список
Период
Сортировка
От Teemu Torma
Тема Re: duplicate key violates unique constraint
Дата
Msg-id 200802261617.39936.teemu@torma.org
обсуждение исходный текст
Ответ на duplicate key violates unique constraint  ("Shavonne Marietta Wijesinghe" <shavonne.marietta@studioform.it>)
Список pgsql-sql
On Tuesday 26 February 2008, Shavonne Marietta Wijesinghe wrote:
> During an "INSERT INTO" I get an "Error - duplicate key violates
> unique constraint...."
>
> Is there any way, that i can test the error. Something like this??
>
> IF error = "duplicate key violates unique constraint" then
>     do something
> else
>     insert into
> end if

insert into ...;
exception when unique_violation then do something;

Teemu


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

Предыдущее
От: "Shavonne Marietta Wijesinghe"
Дата:
Сообщение: duplicate key violates unique constraint
Следующее
От: "Shavonne Marietta Wijesinghe"
Дата:
Сообщение: Re: duplicate key violates unique constraint