Re: Migration problem - serial fields

Поиск
Список
Период
Сортировка
От missive@frontiernet.net (Lee Harr)
Тема Re: Migration problem - serial fields
Дата
Msg-id slrna885rq.55.missive@whave.frontiernet.net
обсуждение исходный текст
Список pgsql-general
> The snag I'm encountering is with Identity fields in SQL7.  I
> discovered the equivalent in PG -- sequences/serial field.  I would
> like to use serial if possible, but here's the problem:  getting the
> existing records over while *keeping the existing values* for the
> Identity/sequence ID fields.  They actually transfer over fine, but
> the next insert into the  PG table generates a duplicate ID error.
> Obviously my transfer did not update the sequence used by the serial
> field -- it's still stuck at 1.  However, I'm just not sure of the
> best course of action.
>


SELECT setval('your_seq_name', 654); -- set higher than highest record.


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Changes to NOW() in 7.2?
Следующее
От: "PG"
Дата:
Сообщение: Slow in VB Grid with PG