On 1 Nov 2002 at 10:59, Bruno Boettcher wrote:
> when inserting from backup the tables are filled with all fields, this
> means alos those defined as serial, but without using nextval...
>
> this means that the sequences for those vars are out of synch with the
> table after the backup...
>
> now there was a sequence to set this up and runnign again, but i cna't
> find it in my papers anymore, so if someone could kindly point me out
> on how to set up the correct values un the sequence i will be really
> grateful.
From createsequence.html in postgresql manual
---------------------------------------
Update the sequence value after a COPY FROM:
BEGIN;
COPY distributors FROM 'input_file';
SELECT setval('serial', max(id)) FROM distributors;
END;
---------------------------------------
Also look at functions-sequence.html for more reference.
HTH
Bye
Shridhar
--
Barometer, n.: An ingenious instrument which indicates what kind of weather we
are having. -- Ambrose Bierce, "The Devil's Dictionary"