Re: Serial not so unique?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Serial not so unique?
Дата
Msg-id 10910.998145633@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Serial not so unique?  (Stephen Robert Norris <srn@commsecure.com.au>)
Ответы Re: Serial not so unique?  (Stephen Robert Norris <srn@commsecure.com.au>)
Список pgsql-general
Stephen Robert Norris <srn@commsecure.com.au> writes:
> On investigation, it seems that the serial number has got to 101, then
> set itself back to 4, causing nextval to return 5, and there are already
> entries from 1-101.

Never heard of such misbehavior before.  What PG version are you
running?  Any chance of providing a reproducible example?

> Has anyone seen anything like this? I can work around it by generating
> a serial number within the application, but that's not ideal.

Frankly, I suspect that the problem *is* in your application.  Sequences
are completely reliable in everyone else's experience... they've got
documented shortcomings like leaving "holes" in their output, but they
don't generate the same nextval() multiple times.

            regards, tom lane

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

Предыдущее
От: "Joe Conway"
Дата:
Сообщение: Re: Serial not so unique?
Следующее
От: Martín Marqués
Дата:
Сообщение: Re: Installing Postrgesql 7.1.2-3