Re: Sequence bug

Поиск
Список
Период
Сортировка
От Andreas Pflug
Тема Re: Sequence bug
Дата
Msg-id 4177C6F6.5010909@pse-consulting.de
обсуждение исходный текст
Ответ на Re: Sequence bug  ("Dave Page" <dpage@vale-housing.co.uk>)
Список pgadmin-hackers
Dave Page wrote:
>
> Hmm, it's not though is it, because (assuming a basic new sequence with
> no odd values set), start = 1, min = 1, max = whatever. PostgreSQL will
> error if you try to set it to zero. The closest thing to zero is to set
> it to 1 and unset is_called.
>
> I would say the least confusing behaviour would be to use
>
> setval('foo', x, true);

I don't agree.
If you CREATE SEQUENCE foo START 100, nextval will return 100. RESTART
100 (7.4/8.0) will lead to the same behaviour, so setval('foo', 100,
false) would be the equivalent.

Actually, currval() would return just 100 too, whether is foo.isCalled
is true or false, i.e. you can't know from that which value will be
returned by nextval(), 100 or 101.
We *could* calculate this when displaying the sequence property, todo
for 1.4?

Regards,
Andreas

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

Предыдущее
От: cvs@cvs.pgadmin.org
Дата:
Сообщение: CVS Commit by andreas: refresh fixes when modifying object from
Следующее
От: cvs@cvs.pgadmin.org
Дата:
Сообщение: CVS Commit by andreas: fix SET DEFAULT FK restriction