Re: BUG #14099: Altering temporary sequence in session has no effect - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #14099: Altering temporary sequence in session has no effect
Date
Msg-id 495.1461001375@sss.pgh.pa.us
Whole thread Raw
In response to BUG #14099: Altering temporary sequence in session has no effect  (imraan@techie.com)
List pgsql-bugs
imraan@techie.com writes:
> Altering a temporary sequence using ALTER SEQUENCE within a session has no
> effect.

It would if you were using the right ALTER SEQUENCE subcommand.
Per the manual:

  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.

  The optional clause RESTART [ WITH restart ] changes the current value
  of the sequence. This is equivalent to calling the setval function with
  is_called = false: the specified value will be returned by the next call
  of nextval. Writing RESTART with no restart value is equivalent to
  supplying the start value that was recorded by CREATE SEQUENCE or last
  set by ALTER SEQUENCE START WITH.

> The ALTER SEQUENCE works on 9.1 and 9.3.

A quick test suggests that this works the same at least as far back as
9.1.

            regards, tom lane

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: BUG #14098: misleading message "out of shared memory" when lock table space exhausted
Next
From: soufiane.boussali@efet.ac.ma
Date:
Subject: BUG #14090: Some installations of Postgres 8 and 9 are configured to allow loading external scripting languages.