Re: Cannot insert dup id in pk

Поиск
Список
Период
Сортировка
От Scott Cain
Тема Re: Cannot insert dup id in pk
Дата
Msg-id 1058287652.1444.8.camel@localhost.localdomain
обсуждение исходный текст
Ответ на Re: Cannot insert dup id in pk  (Dmitry Tkach <dmitry@openratings.com>)
Список pgsql-sql
On Tue, 2003-07-15 at 10:43, Dmitry Tkach wrote:
> You must have your sequence out of date with the content of the table 
> (so that the next value in the sequence has already been inserted).
> One way to get into a situation like that is loading the table data with 
> COPY (the input contains the pks, and the COPY command does not update 
> the sequence, you have to do that manually after the copy is done).

Yes, this is exactly what happened.  I had no idea that copy didn't
update the sequence.  I suspect I've got users who are being bitten by
this and don't realize it.  I'll have to change my "bulk loading" script
to update the sequence after the load is done.

Thanks much,
Scott

-- 
------------------------------------------------------------------------
Scott Cain, Ph. D.                                         cain@cshl.org
GMOD Coordinator (http://www.gmod.org/)                     216-392-3087
Cold Spring Harbor Laboratory



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

Предыдущее
От: "Viorel Dragomir"
Дата:
Сообщение: Re: summing tables
Следующее
От: Stuart
Дата:
Сообщение: Re: Count dates distinct within an interval