Setting sequence ids after importing data

From: "Hari Patel" <hariwise(at)gmail(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: Setting sequence ids after importing data
Date: 2006-05-09 00:43:08
Message-ID: 77a93e850605081743k284b71bby622c2e84918e265d@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

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 ?

Thanks,
Hari

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Sean Davis 2006-05-09 01:13:38 Re: Setting sequence ids after importing data
Previous Message John Purser 2006-05-08 23:57:46 Re: Command line option