duplicate key violate error

Поиск
Список
Период
Сортировка
От AI Rumman
Тема duplicate key violate error
Дата
Msg-id BANLkTik_soP7_Da9kTecJB7HK_1FiOQ09g@mail.gmail.com
обсуждение исходный текст
Ответы Re: duplicate key violate error  ("Albe Laurenz" <laurenz.albe@wien.gv.at>)
Re: duplicate key violate error  (Merlin Moncure <mmoncure@gmail.com>)
Список pgsql-general
Hi,

I got duplicate key violate error in the db log for the following query:
INSERT INTO tab1 ( SELECT '1611576', '1187865' WHERE NOT EXISTS (        SELECT 1 FROM tab1         WHERE id='1611576' AND id2='1187865'    )    )

The error occured during production time.
But when I manually executed the query, it inserted one row with success and next time it inserted 0 rows.

\d tab1
id int
id2 int
primary key (id,id2)

So, any idea why the error occurred at production time.

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

Предыдущее
От: Radosław Smogura
Дата:
Сообщение: Proposition fetch cursors
Следующее
От: Guillaume Lelarge
Дата:
Сообщение: Re: HOW TO install or use pageinspect