Alter sequence restart parameter type

From: PG Doc comments form <noreply(at)postgresql(dot)org>
To: pgsql-docs(at)lists(dot)postgresql(dot)org
Cc: aorlov(at)stiltsoft(dot)com
Subject: Alter sequence restart parameter type
Date: 2021-04-25 19:08:41
Message-ID: 161937772113.687.1837123373170179721@wrigleys.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs

The following documentation comment has been logged on the website:

Page: https://www.postgresql.org/docs/12/sql-altersequence.html
Description:

Hi!
I have some question about alter sequence. I can see in your documentation
https://www.postgresql.org/docs/12/sql-altersequence.html Synopsis:
ALTER SEQUENCE [ IF EXISTS ] name
[ AS data_type ]
[ INCREMENT [ BY ] increment ]
[ MINVALUE minvalue | NO MINVALUE ] [ MAXVALUE maxvalue | NO MAXVALUE
]
[ START [ WITH ] start ]
[ RESTART [ [ WITH ] restart ] ]
[ CACHE cache ] [ [ NO ] CYCLE ]
[ OWNED BY { table_name.column_name | NONE } ]

I use postgresql 12.6. I want to restart my sequence something like that:
alter sequence quiz_seq restart with ((select max(id) from quiz)+1);
but I can't do it. Please, clarify. Can I use only plain numbers like
that?
alter sequence quiz_seq restart with 42;

Is it possible to clarify the type of the parameter RESTART in the
documentation?

Responses

Browse pgsql-docs by date

  From Date Subject
Next Message David G. Johnston 2021-04-26 13:07:15 Re: Alter sequence restart parameter type
Previous Message PG Doc comments form 2021-04-23 17:06:44 Make link to different section