Re: BUG #6300: duplicate key value violates unique constraint

Поиск
Список
Период
Сортировка
От Alex Hunsaker
Тема Re: BUG #6300: duplicate key value violates unique constraint
Дата
Msg-id CAFaPBrTBF6dF1wuBtSkzU1micTgyuY80JgxPkXYu4Ojfa8qf3Q@mail.gmail.com
обсуждение исходный текст
Ответ на Re: BUG #6300: duplicate key value violates unique constraint  (Tigran Mkrtchyan <tigran.mkrtchyan@desy.de>)
Список pgsql-bugs
On Fri, Nov 18, 2011 at 14:31, Tigran Mkrtchyan
<tigran.mkrtchyan@desy.de> wrote:
>
> On Fri, Nov 18, 2011 at 9:52 PM, Tomas Vondra <tv@fuzzy.cz> wrote:

> > Anyway this definitely is not a bug,
>
> Still not convinced.

You are unlikely to convince anyone here otherwise... Its works that
way by design.

>  [...] I don't think you will be happy of /var/log/messages will be
> full of error messages when a user tries to create an existing file.
> Well, of course I can check myself the file exists, but why I need DB
> transactions if my application have to take care about that.

If you don't want them logged you could 'catch' them by creating a
wrapper function in plpsql, something like:
http://www.postgresql.org/docs/9.1/interactive/plpgsql-control-structures.html#PLPGSQL-UPSERT-EXAMPLE

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

Предыдущее
От: Tigran Mkrtchyan
Дата:
Сообщение: Re: BUG #6300: duplicate key value violates unique constraint
Следующее
От: lindebg@gmail.com
Дата:
Сообщение: Re: BUG #6299: pg_dump, pg_dumpall - Problem with the order of backup functions