Re: how to alter sequence.

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Oliver Elphick <olly(at)lfix(dot)co(dot)uk>
Cc: raja kumar thatte <trajakumar(at)yahoo(dot)com>, pgsql-hackers(at)postgresql(dot)org, pgsql-admin(at)postgresql(dot)org
Subject: Re: how to alter sequence.
Date: 2002-12-04 18:23:40
Message-ID: 200212041823.gB4INeQ07044@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin pgsql-hackers

Oliver Elphick wrote:
> On Wed, 2002-12-04 at 12:29, raja kumar thatte wrote:
> > Hai friends,
> > I have a sequence called raj_seq with max value 3000.
> ...
> > now i wanted to increase the max value of the raj_seq
> > to 9999999.
> > How to do this change?
> > If i drop and recreate the raj_seq, then i have to
> > recreate the table and all triggers working on that
> > table.But it is not an acceptable solution.
> > So with out droping raj_seq , how do I solve this
> > problem.
>
> Unfortunately there doesn't seem to be any easy way to do this. There
> is no ALTER SEQUENCE command and you can't use UPDATE on a sequence.

Gee, I thought they could just update the sequence table, but I see:

test=> update yy set max_value = 100;
ERROR: You can't change sequence relation yy

> Hackers: Could this be a TODO item for 7.4?

Added to TODO:

* Add ALTER SEQUENCE to modify min/max/increment/cache/cycle values

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Bruce Momjian 2002-12-04 18:27:07 Re: how to cancel a query ?
Previous Message Oliver Elphick 2002-12-04 17:54:07 Re: [HACKERS] how to alter sequence.

Browse pgsql-hackers by date

  From Date Subject
Next Message Patrick Welche 2002-12-04 18:32:19 postgres core FALSE ALARM
Previous Message Patrick Welche 2002-12-04 18:18:44 postgres core dump PS