Re: How overcome wait for vacuum full?

Поиск
Список
Период
Сортировка
От Geoff Tolley
Тема Re: How overcome wait for vacuum full?
Дата
Msg-id 464A45C4.6090607@polimetrix.com
обсуждение исходный текст
Ответ на Re: How overcome wait for vacuum full?  (Nick Urbanik <nicku@nicku.org>)
Ответы Re: How overcome wait for vacuum full?  ("Joshua D. Drake" <jd@commandprompt.com>)
Список pgsql-admin
Nick Urbanik wrote:

> It seems that PostgreSQL 7.3.8 does not support create table
> table_name like original_table.
>
> Can you suggest a way I can create a duplicate table with the same
> triggers and other stuff that this table has?
>
> What is the most efficient way to copy the data?

Something like:

CREATE TABLE mytable_copy AS SELECT * FROM mytable;
ALTER TABLE mytable RENAME TO mytable_old;
ALTER TABLE mytable_copy RENAME TO mytable;
/*
Now add primary key, indices, foreign keys, triggers, rules, column
defaults to mytable, and you'll probably want to drop the foreign keys at
least from mytable_old. I'm afraid you'll have to sort out manually what
these should be.
*/

7.3.8 is quite seriously old. 7.3.19 is the latest in that tree if you must
stick with it.

HTH,
Geoff

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

Предыдущее
От: Nick Urbanik
Дата:
Сообщение: How far does interrupting vacuum full rollback?
Следующее
От: "Joshua D. Drake"
Дата:
Сообщение: Re: How overcome wait for vacuum full?