Re: Cannot insert a duplicate key into unique index - Mailing list pgsql-novice

From
Subject Re: Cannot insert a duplicate key into unique index
Date
Msg-id 200402191203.i1JC3Pq02831@panix3.panix.com
Whole thread Raw
In response to Re: Cannot insert a duplicate key into unique index  (daq <daq@ugyvitelszolgaltato.hu>)
Responses Re: Cannot insert a duplicate key into unique index  (daq <daq@ugyvitelszolgaltato.hu>)
List pgsql-novice

   Date: Thu, 19 Feb 2004 08:01:04 +0100
   From: daq <daq@ugyvitelszolgaltato.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


pgsql-novice by date:

Previous
From: daq
Date:
Subject: Re: Cannot insert a duplicate key into unique index
Next
From: daq
Date:
Subject: Re: Cannot insert a duplicate key into unique index