Re: AutoIncrement not working on this table only

Поиск
Список
Период
Сортировка
От Kassel Ben CRBE
Тема Re: AutoIncrement not working on this table only
Дата
Msg-id 1F9F67162ADED3119F18009027A8F404025FC3A2@crbeex03.dt.navy.mil
обсуждение исходный текст
Ответ на AutoIncrement not working on this table only  ("Ben Kassel" <benk@ix.netcom.com>)
Список pgsql-novice
A huge thank you to all who helped me solve my problem. To synopsize for those keeping a lessons learned:

The sequence table got out of sync with the with the column being sequenced. This was mot probably caused by reloading
dataimproperly without regard for the sequence generated value.  

The sequence can be resynced using the command:

select (setval('my_seq',max(my_col)) from my_table;

or in my case the actual command which solved the problem:

SELECT setval('datadef_datadefindex_seq',MAX(datadefindex)) from datadef;

later,
ben

В списке pgsql-novice по дате отправления:

Предыдущее
От: Josh Berkus
Дата:
Сообщение: Re: Novice DB Schema question
Следующее
От: "Brian Johnson"
Дата:
Сообщение: List sequence assigned to primary key