Re: Problems with unique restrictions

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Problems with unique restrictions
Дата
Msg-id 24871.1168705352@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Problems with unique restrictions  ("Marcel Gsteiger" <Marcel.Gsteiger@milprog.ch>)
Список pgsql-general
"Marcel Gsteiger" <Marcel.Gsteiger@milprog.ch> writes:
> Now since I upgraded to 8.2 I have problems inserting data into tables that have unique indexes. Ugly enough, I get
themessage 'duplicate key violates unique constraint' when inserting the very first record into a table. This happens
everytimewhen the new tuple references another tuple that has been inserted just before this one in the same
transaction.

> Putting a "SET CONSTRAINTS ALL DEFERRED" in my procedure does not help.

> To me it looks that something with referential integrity checking goes wrong, but in this case the error message
wouldbe misleading. 

RI would not have anything to do with a duplicate-key error.

Do you have any SERIAL-type columns in these tables?  My first thought
is of a sequence that hasn't been updated to be above the existing ID
values.  It's fairly easy to get into such a state if you do anything
but a plain vanilla dump-all-and-reload-all update process ...

            regards, tom lane

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: FK Constraint on index not PK
Следующее
От: Tom Lane
Дата:
Сообщение: Re: FK Constraint on index not PK