Re: BUG #5629: ALTER SEQUENCE foo START execute a RESTART - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #5629: ALTER SEQUENCE foo START execute a RESTART
Date
Msg-id 29850.1282921889@sss.pgh.pa.us
Whole thread Raw
In response to Re: BUG #5629: ALTER SEQUENCE foo START execute a RESTART  (Alexsander Rosa <alexsander.rosa@gmail.com>)
Responses Re: BUG #5629: ALTER SEQUENCE foo START execute a RESTART
List pgsql-bugs
Alexsander Rosa <alexsander.rosa@gmail.com> writes:
> Let me get this straight: in version 8.3 the ALTER SEQUENCE command has an
> *undocumented* [1] clause START that is actually an alias for RESTART (i.e.
> both reset the sequence value to the value passed by the mandatory
> argument).

Yeah.  I just looked at the old code a bit.  This behavior was an
artifact of a sloppy implementation: internally, CREATE SEQUENCE ...
START WITH x did the same thing as ALTER SEQUENCE ... RESTART WITH x, so
the code didn't prevent you from using either spelling in either place.
But it wasn't documented or intended that you should write CREATE
SEQUENCE RESTART or ALTER SEQUENCE START.

As of 8.4 ALTER SEQUENCE START has an actually designed meaning, which
is different from ALTER SEQUENCE RESTART.  This wasn't documented as an
incompatibility because the syntax wasn't supposed to exist at all
before that.

I'm not inclined to go and retroactively document that these spellings
are possible but deprecated in the old branches.  I think that would
just confuse matters even more.

            regards, tom lane

pgsql-bugs by date:

Previous
From: Alexsander Rosa
Date:
Subject: Re: BUG #5629: ALTER SEQUENCE foo START execute a RESTART
Next
From: "tbz"
Date:
Subject: BUG #5630: CREATE INDEX does not use schema search path