Re: Moving tables between schemas

Поиск
Список
Период
Сортировка
От Shridhar Daithankar
Тема Re: Moving tables between schemas
Дата
Msg-id 200407301541.48304.shridhar@frodo.hserus.net
обсуждение исходный текст
Ответ на Moving tables between schemas  ("m.e.bruche@lse.ac.uk" <m.e.bruche@lse.ac.uk>)
Список pgsql-general
On Friday 30 Jul 2004 3:56 pm, m.e.bruche@lse.ac.uk wrote:
> Hi,
>
> In my database, I created a lot of tables before I found out about
> schemas. It's a mess!
>
> Suppose I want to get organised, and create a couple of schemas. How do
> I move existing tables into my newly created schemas?
>
> e.g.
>
> public.table1 -> mynewschema1.table1
> public.table2 -> mynewschema2.table2

You can dump the tables, edit the dump to alter the create table statement so
that the table is created in proper schema.

This could be very rudimentary depending upon size of each table and number of
tables. The local documentation of 7.4.3 indicates that either alter table or
alter schema does not support moving tables between schemas.

You could resort to catalog hacking and change the schema manually but I am
not sure how advisable and predictable it would be.

HTH

 Shridhar

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

Предыдущее
От: Nilabhra Banerjee
Дата:
Сообщение: Postgresql and OS cluster
Следующее
От: John Sidney-Woollett
Дата:
Сообщение: Re: Moving tables between schemas