Re: Alter sequence restart parameter type

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: "aorlov(at)stiltsoft(dot)com" <aorlov(at)stiltsoft(dot)com>, "pgsql-docs(at)lists(dot)postgresql(dot)org" <pgsql-docs(at)lists(dot)postgresql(dot)org>
Subject: Re: Alter sequence restart parameter type
Date: 2021-04-26 13:07:15
Message-ID: CAKFQuwYZN232n3eWUFRc3dwkLEqCRd+QG+6EuvavoRq_K+yHpQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs

On Sunday, April 25, 2021, PG Doc comments form <noreply(at)postgresql(dot)org>
wrote:

>
> 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;

Yes

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

Not,desirable. This command isn’t special with regard to the fact the
utility commands don’t get to use embedded queries to supply values.
Though you can just write some pl/pgsql and build a dynamic command.

David J.

In response to

Browse pgsql-docs by date

  From Date Subject
Next Message PG Doc comments form 2021-04-26 21:55:25 "68.4. Visibility Map" change suggestion.
Previous Message PG Doc comments form 2021-04-25 19:08:41 Alter sequence restart parameter type