Date: Thu, 19 Feb 2004 08:01:04 +0100
From: daq <daq(at)ugyvitelszolgaltato(dot)hu>
The setval function updates the last_value field of the sequence table. You don't need the "+ 1".
select setval('seq-name', (select max(col) from table));
Thank you all for the help. I'm almost there.
How can I list all the sequences in the database, with their
attributes (such as last_value)? (I'm having a hard time guessing
'seq-name'; the 'A_id_seq' formula did not work.)
For that matter (going beyond my original question) does PostgreSQL
have anything like a comprehensive "catalog" function that will list
all the tables, their fields, etc. defined in the database?
Thanks!
kj