Re: Setting sequence ids after importing data

Поиск
Список
Период
Сортировка
От Sean Davis
Тема Re: Setting sequence ids after importing data
Дата
Msg-id 445FECC2.1070700@mail.nih.gov
обсуждение исходный текст
Ответ на Setting sequence ids after importing data  ("Hari Patel" <hariwise@gmail.com>)
Ответы Re: Setting sequence ids after importing data  ("Hari Patel" <hariwise@gmail.com>)
Список pgsql-novice
Hari Patel wrote:
> Hi:
>
> I am importing data from sqlite db into postgres. The tables have an id
> column that is obtained from a sequence.
>
> To preserve the foreign key relationships, I need to preserve the ids
> while importing into postgres.
>
> The problem is that after import, the sequences don't get incremented
> which leads to unique constraint violation errors further down.
> How do I fix this ?

See here in the documentation:

http://www.postgresql.org/docs/8.1/static/functions-sequence.html

SEan

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

Предыдущее
От: "Hari Patel"
Дата:
Сообщение: Setting sequence ids after importing data
Следующее
От: "Hari Patel"
Дата:
Сообщение: Re: Setting sequence ids after importing data