Thread: [DOCS] 'alter sequence xxx start 200' do nothing

[DOCS] 'alter sequence xxx start 200' do nothing

From
eric.mordant@free.fr
Date:
The following documentation comment has been logged on the website:

Page: https://www.postgresql.org/docs/9.5/static/functions-sequence.html
Description:

Hello,

According to the doc, with a sequence public.xxx working well, i tried:

Alter sequence public.xxx start 200;

and also:
Alter sequence public.xxx start with 200

It has no effect, without error message, but setval(200) work fine

Misunderstand the doc or is it a bug (PostgreSql 9.6 x86 on localhost) ?


Re: [DOCS] 'alter sequence xxx start 200' do nothing

From
Guillaume Lelarge
Date:
2017-09-05 8:51 GMT+02:00 <eric.mordant@free.fr>:
The following documentation comment has been logged on the website:

Page: https://www.postgresql.org/docs/9.5/static/functions-sequence.html
Description:

Hello,

According to the doc, with a sequence public.xxx working well, i tried:

Alter sequence public.xxx start 200;

and also:
Alter sequence public.xxx start with 200

It has no effect, without error message, but setval(200) work fine

Misunderstand the doc or is it a bug (PostgreSql 9.6 x86 on localhost) ?


They don't do the same thing. ALTER SEQUENCE ... START ... sets the start value, while setval sets the current value.


--
Guillaume.

Re: [DOCS] 'alter sequence xxx start 200' do nothing

From
"David G. Johnston"
Date:
On Mon, Sep 4, 2017 at 11:51 PM, <eric.mordant@free.fr> wrote:
The following documentation comment has been logged on the website:

Page: https://www.postgresql.org/docs/9.5/static/functions-sequence.html

Alter sequence public.xxx start with 200

It has no effect, without error message, but setval(200) work fine

Misunderstand the doc or is it a bug (PostgreSql 9.6 x86 on localhost) ?
​​

​From the  SQL Commands "ALTER SEQUENCE" chapter:

"The optional clause START WITH start changes the recorded start value of the sequence. This has no effect on the current sequence value; it simply sets the value that future ALTER SEQUENCE RESTART commands will use."  (emphasis mine)


David J.