Re: Migration problem - serial fields

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Migration problem - serial fields
Дата
Msg-id 11808.1015523961@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Migration problem - serial fields  (rick@planetdigital.com (Rick))
Список pgsql-general
rick@planetdigital.com (Rick) writes:
> 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.

No, it wouldn't.  After you transfer the data, advance the sequence
with something like

SELECT setval('seqname', (SELECT max(serialcol) FROM table));

and then you're good to go.

            regards, tom lane

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Temp Tables
Следующее
От: Neil Conway
Дата:
Сообщение: Re: HELP!.. "semget(key=2, num=17, 03600) failed: No