Re: [ADMIN] how to alter sequence.

Поиск
Список
Период
Сортировка
От Oliver Elphick
Тема Re: [ADMIN] how to alter sequence.
Дата
Msg-id 1039010812.11433.75.camel@linda.lfix.co.uk
обсуждение исходный текст
Ответы Re: [ADMIN] how to alter sequence.  (Hannu Krosing <hannu@tm.ee>)
Re: [ADMIN] how to alter sequence.  (Rod Taylor <rbt@rbt.ca>)
Re: [ADMIN] how to alter sequence.  (Bruce Momjian <pgman@candle.pha.pa.us>)
Список pgsql-hackers
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.

Hackers: Could this be a TODO item for 7.4?


The easiest way to do this at present is probably to dump the database,
edit the dump to change the sequence max_value and then recreate the
database from the edited dump.  I presume you used CREATE SEQUENCE in
order to get such a low max_value.  If it were created from a SERIAL
datatype, you would also have to edit the table definition to use a
pre-created sequence.  There is no means of specifying a max_value using
SERIAL.

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


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Vince Vielhaber
Дата:
Сообщение: Re: [GENERAL] PostgreSQL Global Development Group Announces
Следующее
От: Hannu Krosing
Дата:
Сообщение: Re: MySQL update