Re: Make an id field max(id)+1 rather than SERIAL

From: Vijay Deval <deval(at)giaspn01(dot)vsnl(dot)net(dot)in>
To: Rory Campbell-Lange <rory(at)campbell-lange(dot)net>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: Make an id field max(id)+1 rather than SERIAL
Date: 2002-09-22 16:03:30
Message-ID: 3D8DE9D2.24EA417A@giaspn01.vsnl.net.in
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Hi
after inserting bulk data, Select Max of the sequence.

SELECT setval('abc_xyz_seq', max value);

should get the sequence in synchro.

Vijay

Rory Campbell-Lange wrote:
>
> I have problems after exporting then importing data into newly created
> databases that the sequence and the indexed serial fields get out of
> alignment.

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Norman Khine 2002-09-22 21:17:59 Subselect query for a multi table insert single query
Previous Message Tom Lane 2002-09-20 23:57:18 Re: table corruption... :(