pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Oliver Elphick <olly@lfix.co.uk>
To: Dustin Sallings <dustin@spy.net>
Cc: Hannu Krosing <hannu@tm.ee>
Cc: raja kumar thatte <trajakumar@yahoo.com>
Cc: pgsql-hackers@postgresql.org <pgsql-hackers@postgresql.org>
Cc: pgsql-admin@postgresql.org
Subject: Re: [HACKERS] how to alter sequence.
Date: 04 Dec 2002 17:54:07 +0000
Message-ID: <1039024446.11430.566.camel@linda.lfix.co.uk> (raw)
In-Reply-To: <Pine.SGI.4.50.0212040933410.22447-100000@bleu.west.spy.net>
References: <20021204122900.96540.qmail@web20608.mail.yahoo.com>
	<1039010812.11433.75.camel@linda.lfix.co.uk>
	<1039016518.2281.17.camel@rh72.home.ee>
	<Pine.SGI.4.50.0212040933410.22447-100000@bleu.west.spy.net>

On Wed, 2002-12-04 at 17:33, Dustin Sallings wrote:
> 	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)

It's not the issue.  The original question was how to change the upper
limit of the sequence's range, not its current value.

        junk=# create sequence foo_seq maxvalue 3000;
        CREATE SEQUENCE
        junk=# select nextval('foo_seq');
         nextval 
        ---------
               1
        (1 row)
        
        junk=# select setval('foo_seq', 999999);
        ERROR:  foo_seq.setval: value 999999 is out of bounds (1,3000)

-- 
Oliver Elphick <olly@lfix.co.uk>
LFIX Limited




view thread (23+ messages)  latest in thread

Message-ID: <1039024446.11430.566.camel@linda.lfix.co.uk>
Permalink:  ../1039024446.11430.566.camel@linda.lfix.co.uk/
Also on:    postgresql.org/message-id/1039024446.11430.566.camel@linda.lfix.co.uk

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: olly@lfix.co.uk, dustin@spy.net, hannu@tm.ee, trajakumar@yahoo.com, pgsql-hackers@postgresql.org
  Subject: Re: [HACKERS] how to alter sequence.
  In-Reply-To: <1039024446.11430.566.camel@linda.lfix.co.uk>
  References: <20021204122900.96540.qmail@web20608.mail.yahoo.com> <1039010812.11433.75.camel@linda.lfix.co.uk> <1039016518.2281.17.camel@rh72.home.ee> <Pine.SGI.4.50.0212040933410.22447-100000@bleu.west.spy.net> <1039024446.11430.566.camel@linda.lfix.co.uk>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox