Re: Renaming tables to other schemas

Поиск
Список
Период
Сортировка
От Rod Taylor
Тема Re: Renaming tables to other schemas
Дата
Msg-id 1077291855.25444.263.camel@jester
обсуждение исходный текст
Ответ на Re: Renaming tables to other schemas  (Robert Treat <xzilla@users.sourceforge.net>)
Список pgsql-hackers
> Rod, can you lay out some psdueo code / logic involved in the process?  I'm 
> guessing you lock the entry in pg_class, you up dependent objects, lock them, 
> update them all... is there more to it?

It was one an offline database at the time with only a single user -- so
locking wasn't a concern at the time.

To change the namespace of a table, update the namespace ID for:

pg_class -> of table
pg_type -> of table
pg_class -> index(es) on table
pg_type -> of indexes on table
pg_constraint -> all constraints on table
pg_depend -> dependencies of above objects on the namespace

We didn't have inheritance or the more exotic items, but I seem to
recall the views continued to work as expected with no changes.

Dump and restore gave us what we expected, and the database functions as
expected but that doesn't necessarily mean the above covers all items.




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

Предыдущее
От: Robert Treat
Дата:
Сообщение: Re: Renaming tables to other schemas
Следующее
От: Robert Treat
Дата:
Сообщение: Re: [Resend: Domains and function]