Re: catching up an id sequence

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: catching up an id sequence
Дата
Msg-id 17333.1091138467@sss.pgh.pa.us
обсуждение исходный текст
Ответ на catching up an id sequence  (Austin Swinney <austin@interactivate.com>)
Список pgsql-novice
Austin Swinney <austin@interactivate.com> writes:
> Hi most esteemed novices and experts.  It is an honor to post here!
> I imported a MySQL dump into PostgreSQL (7.4.3) and was wondering what
> a good way to catch up the ID sequence table to be current with the
> table I imported.

You want setval().  The usual approach is

    select setval('tab_col_seq', (select max(col) from tab) + 1);

            regards, tom lane

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

Предыдущее
От: Austin Swinney
Дата:
Сообщение: catching up an id sequence
Следующее
От: Steve Tucknott
Дата:
Сообщение: Significant spaces