Re: Duplicate key insert question

Поиск
Список
Период
Сортировка
От Jean-Christian Imbeault
Тема Re: Duplicate key insert question
Дата
Msg-id 3F0238D4.1030307@mega-bucks.co.jp
обсуждение исходный текст
Ответ на Duplicate key insert question  (Jean-Christian Imbeault <jc@mega-bucks.co.jp>)
Список pgsql-general
Alvaro Herrera wrote:
>
> Well, he is right.  One will fail, the other will not.  The race
> condition is for the application.  If you want to ignore it, you can do
> that, but there _will_ be an ERROR thrown and the transaction will be
> aborted.

Ah ... then maybe this solution is 'good enough'. It will still generate
 an error message some of the time (when there is a race condition) but
will definitely generate fewer error messages than the current method
used which is just to do the insert and let it fail if there is already
a record with the same primary key.

Thanks for the help!

Jean-Christian Imbeault


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

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: Re: Duplicate key insert question
Следующее
От: "Dann Corbit"
Дата:
Сообщение: Re: Duplicate key insert question