Re: Cannot insert a duplicate key into unique index
| От | |
|---|---|
| Тема | Re: Cannot insert a duplicate key into unique index |
| Дата | |
| Msg-id | 200402191203.i1JC3Pq02831@panix3.panix.com обсуждение исходный текст |
| Ответ на | Re: Cannot insert a duplicate key into unique index (daq <daq@ugyvitelszolgaltato.hu>) |
| Ответы |
Re: Cannot insert a duplicate key into unique index
|
| Список | 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 по дате отправления: