Re: Setting sequence ids after importing data - Mailing list pgsql-novice

From Sean Davis
Subject Re: Setting sequence ids after importing data
Date
Msg-id 445FECC2.1070700@mail.nih.gov
Whole thread Raw
In response to Setting sequence ids after importing data  ("Hari Patel" <hariwise@gmail.com>)
Responses Re: Setting sequence ids after importing data
List 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 by date:

Previous
From: "Hari Patel"
Date:
Subject: Setting sequence ids after importing data
Next
From: "Hari Patel"
Date:
Subject: Re: Setting sequence ids after importing data