Re: BUG #5629: ALTER SEQUENCE foo START execute a RESTART

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: BUG #5629: ALTER SEQUENCE foo START execute a RESTART
Дата
Msg-id 29850.1282921889@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: BUG #5629: ALTER SEQUENCE foo START execute a RESTART  (Alexsander Rosa <alexsander.rosa@gmail.com>)
Ответы Re: BUG #5629: ALTER SEQUENCE foo START execute a RESTART  (Euler Taveira de Oliveira <euler@timbira.com>)
Список 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 по дате отправления:

Предыдущее
От: Alexsander Rosa
Дата:
Сообщение: Re: BUG #5629: ALTER SEQUENCE foo START execute a RESTART
Следующее
От: "tbz"
Дата:
Сообщение: BUG #5630: CREATE INDEX does not use schema search path