Re: setval('myfunsequence', 0)

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: setval('myfunsequence', 0)
Дата
Msg-id 11053.1039193845@sss.pgh.pa.us
обсуждение исходный текст
Ответ на setval('myfunsequence', 0)  ("Ian Harding" <ianh@tpchd.org>)
Список pgsql-general
"Ian Harding" <ianh@tpchd.org> writes:
> I can just create this particular sequence with minvalue 0 start 1, but I am wondering what is the downside to this
beingthe default?  Alternatively, is there a way to make setval accept a value that is $start - $increment as seems to
happenon creation? 

There's a separate bit in the sequence state that causes it not to
advance on first call; this allows the initial state to be $start
and not $start - $increment (which might underflow).

In recent PG versions you can manipulate the no-advance flag with
a 3-parameter setval() call.

            regards, tom lane

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