Skip site navigation (1) Skip section navigation (2)

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: (view raw, whole thread or download thread mbox)
Lists: pgsql-novice
after inserting bulk data, Select Max of the sequence.

SELECT setval('abc_xyz_seq', max value);

should get the sequence in synchro.


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

pgsql-novice by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group