Re: Problems with sequences

Поиск
Список
Период
Сортировка
От Merlin Moncure
Тема Re: Problems with sequences
Дата
Msg-id b42b73150609061748vfe778d4h2265ae9ce95f9848@mail.gmail.com
обсуждение исходный текст
Ответ на Problems with sequences  ("Arturo Perez" <aperez@hayesinc.com>)
Ответы Re: Problems with sequences
Список pgsql-general
On 9/6/06, Arturo Perez <aperez@hayesinc.com> wrote:
> What happens is that if I do a select nextval('seq') I get a number
> that's lower than the
> max primary key id.  This is inspite of my doing
>    SELECT setval('seq', ((SELECT MAX(seq_ID) FROM table)+1))
>    ALTER SEQUENCE seq RESTART WITH <max + 1>;
>    select pg_catalog.setval(seq, <max+1>, true);
>

are you running those statements to fetch the next key in the table?
you might have a race condition there.  try wrappnig in a userlock.

merlin

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

Предыдущее
От: Steve Atkins
Дата:
Сообщение: Re: On DNS for postgresql.org
Следующее
От: Tim Allen
Дата:
Сообщение: Re: On DNS for postgresql.org