Re: Moving tables between schemas

Поиск
Список
Период
Сортировка
От Shridhar Daithankar
Тема Re: Moving tables between schemas
Дата
Msg-id 200407301618.13632.shridhar@frodo.hserus.net
обсуждение исходный текст
Ответ на Re: Moving tables between schemas  (John Sidney-Woollett <johnsw@wardbrook.com>)
Список pgsql-general
On Friday 30 Jul 2004 3:49 pm, John Sidney-Woollett wrote:
> You may be able to play around with the system catalogs, but I don't
> know anything about that...
>
> An easy method of moving the tables are
>
> create table mynewschema1.table1 as select * from public.table1;
> drop public.table1;
>
> create table mynewschema2.table2as select * from public.table2;
> drop public.table2;

One can also create a table before hand using 'create table like' and then
inserting rows. This has advantage of preserving any constraints in original
table.

But this does not take care of indexes AFAIK.

 Shridhar

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

Предыдущее
От: John Sidney-Woollett
Дата:
Сообщение: Re: Moving tables between schemas
Следующее
От: "Jason Tesser"
Дата:
Сообщение: Re: Wal logs