Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1asDD6-0003LM-2I for pgsql-bugs@arkaria.postgresql.org; Mon, 18 Apr 2016 17:43:44 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1asDD5-0005Iq-Jj for pgsql-bugs@arkaria.postgresql.org; Mon, 18 Apr 2016 17:43:43 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1asDCS-0004bx-W3 for pgsql-bugs@postgresql.org; Mon, 18 Apr 2016 17:43:05 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1asDCL-00029s-FD for pgsql-bugs@postgresql.org; Mon, 18 Apr 2016 17:43:04 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id u3IHgteX000496; Mon, 18 Apr 2016 13:42:55 -0400 From: Tom Lane To: imraan@techie.com cc: pgsql-bugs@postgresql.org Subject: Re: BUG #14099: Altering temporary sequence in session has no effect In-reply-to: <20160418171347.22920.22798@wrigleys.postgresql.org> References: <20160418171347.22920.22798@wrigleys.postgresql.org> Comments: In-reply-to imraan@techie.com message dated "Mon, 18 Apr 2016 17:13:47 -0000" Date: Mon, 18 Apr 2016 13:42:55 -0400 Message-ID: <495.1461001375@sss.pgh.pa.us> X-Pg-Spam-Score: -2.9 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org 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 -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs