pg.ddx.io pgsql-docs@postgresql.org mailing list archive
help / color / mirror / Atom feed'alter sequence xxx start 200' do nothing
3+ messages / 3 participants
[nested] [flat]
* 'alter sequence xxx start 200' do nothing
@ 2017-09-05 06:51 eric.mordant@free.fr
0 siblings, 2 replies; 3+ messages in thread
From: eric.mordant@free.fr @ 2017-09-05 06:51 UTC (permalink / raw)
To: pgsql-docs
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) ?
--
Sent via pgsql-docs mailing list (pgsql-docs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-docs
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: 'alter sequence xxx start 200' do nothing
@ 2017-09-05 07:17 Guillaume Lelarge <guillaume@lelarge.info>
parent: eric.mordant@free.fr
1 sibling, 0 replies; 3+ messages in thread
From: Guillaume Lelarge @ 2017-09-05 07:17 UTC (permalink / raw)
To: eric.mordant@free.fr; +Cc: pgsql-docs
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.
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: 'alter sequence xxx start 200' do nothing
@ 2017-09-05 13:53 David G. Johnston <david.g.johnston@gmail.com>
parent: eric.mordant@free.fr
1 sibling, 0 replies; 3+ messages in thread
From: David G. Johnston @ 2017-09-05 13:53 UTC (permalink / raw)
To: eric.mordant@free.fr; +Cc: pgsql-docs
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)
https://www.postgresql.org/docs/9.5/static/sql-altersequence.html
David J.
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2017-09-05 13:53 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2017-09-05 06:51 'alter sequence xxx start 200' do nothing eric.mordant@free.fr
2017-09-05 07:17 ` Guillaume Lelarge <guillaume@lelarge.info>
2017-09-05 13:53 ` David G. Johnston <david.g.johnston@gmail.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox