Re: [HACKERS] how to alter sequence.
Joel Burton <joel@joelburton.com>
From: Joel Burton <joel@joelburton.com>
To: Dustin Sallings <dustin@spy.net>
Cc: Hannu Krosing <hannu@tm.ee>, Oliver Elphick <olly@lfix.co.uk>, raja kumar thatte <trajakumar@yahoo.com>, "pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>, pgsql-admin@postgresql.org
Date: 2002-12-04T17:44:50Z
Lists: pgsql-hackers
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