Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id B77344766BC; Wed, 4 Dec 2002 12:50:10 -0500 (EST) Received: from temp.joelburton.com (65.eebed1.client.atlantech.net [209.190.238.101]) by postgresql.org (Postfix) with ESMTP id 89A8B476828; Wed, 4 Dec 2002 12:44:45 -0500 (EST) Received: by temp.joelburton.com (Postfix, from userid 501) id AAC722BA27; Wed, 4 Dec 2002 12:44:50 -0500 (EST) Date: Wed, 4 Dec 2002 12:44:50 -0500 From: Joel Burton To: Dustin Sallings Cc: Hannu Krosing , Oliver Elphick , raja kumar thatte , "pgsql-hackers@postgresql.org" , pgsql-admin@postgresql.org Subject: Re: [HACKERS] how to alter sequence. Message-ID: <20021204174450.GA17010@temp.joelburton.com> References: <20021204122900.96540.qmail@web20608.mail.yahoo.com> <1039010812.11433.75.camel@linda.lfix.co.uk> <1039016518.2281.17.camel@rh72.home.ee> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.3.25i X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200212/37 X-Sequence-Number: 6532 On Wed, Dec 04, 2002 at 09:33:52AM -0800, Dustin Sallings wrote: > Around 20:41 on Dec 4, 2002, Hannu Krosing said: > > What's wrong with this: > > dustin=# create sequence test_seq; > CREATE SEQUENCE > dustin=# select nextval('test_seq'); > nextval > --------- > 1 > (1 row) > > dustin=# select setval('test_seq', 9999); > setval > -------- > 9999 > (1 row) > > dustin=# select nextval('test_seq'); > nextval > --------- > 10000 > (1 row) Dustin -- The thread here is about how to raise the *max* value for the sequence, not how to set the current value higher. The sequence in question was created with a too-low maximum value (see help on CREATE SEQUENCE for options); the user now wants to raise it. - J. -- Joel BURTON | joel@joelburton.com | joelburton.com | aim: wjoelburton Independent Knowledge Management Consultant