From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | imraan(at)techie(dot)com |
Cc: | pgsql-bugs(at)postgresql(dot)org |
Subject: | Re: BUG #14099: Altering temporary sequence in session has no effect |
Date: | 2016-04-18 17:42:55 |
Message-ID: | 495.1461001375@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-bugs |
imraan(at)techie(dot)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
From | Date | Subject | |
---|---|---|---|
Next Message | Javier Mogetta | 2016-04-18 17:50:50 | Error instalación PostgreSQL 8.2 en Win10 |
Previous Message | Tom Lane | 2016-04-18 17:37:11 | Re: BUG #14098: misleading message "out of shared memory" when lock table space exhausted |