Re: changing the sequence for a table

Поиск
Список
Период
Сортировка
От Richard Huxton
Тема Re: changing the sequence for a table
Дата
Msg-id 42B04BE0.3060604@archonet.com
обсуждение исходный текст
Ответ на changing the sequence for a table  (Cedric BRINER <work@infomaniak.ch>)
Список pgsql-general
Cedric BRINER wrote:
>
> the idea is to drop the ``old_test'' table. But before doing this,
 > I'd like to alter the table ``test'' to use the sequence
 > ``test_id_seq'' instead of ``test_new_seq_id''?

ALTER TABLE new_table ALTER COLUMN my_column DROP DEFAULT;
ALTER TABLE new_table ALTER COLUMN my_column SET DEFAULT
(nextval('old_seq'));
DROP TABLE old_table;

Or something along those lines. See "ALTER TABLE" in the manuals for
details.
--
   Richard Huxton
   Archonet Ltd

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

Предыдущее
От: David Siebert
Дата:
Сообщение: vacuumdb suggestions?
Следующее
От: stig erikson
Дата:
Сообщение: Re: postgresql rpms (7.4.2, 7.4.5, 7.4.8) for redhat 8.0