ALTER TABLE schema SCHEMA TO new_schema?
| От | Joe Conway |
|---|---|
| Тема | ALTER TABLE schema SCHEMA TO new_schema? |
| Дата | |
| Msg-id | 3DE99DD0.5080209@joeconway.com обсуждение исходный текст |
| Ответы |
Re: ALTER TABLE schema SCHEMA TO new_schema?
|
| Список | pgsql-hackers |
Someone asked earlier about how to change a bunch of existing tables int the
PUBLIC schema to some other schema. For grins I tried:
regression=# select oid,* from pg_namespace ; oid | nspname | nspowner | nspacl
--------+------------+----------+-------- 11 | pg_catalog | 1 | {=U} 99 | pg_toast | 1 | {=}
2200| public | 1 | {=UC} 16766 | pg_temp_1 | 1 | 556829 | bar | 1 |
(5 rows)
regression=# update pg_class set relnamespace=556829 where relname = 'foo' and
relnamespace=2200;
UPDATE 1
and it seemed to work fine (i.e. moved foo from schema public to schema bar).
But it made me wonder if we shouldn't have:
ALTER TABLE table SCHEMA TO new_schema
as a supported method to do this?
Joe
В списке pgsql-hackers по дате отправления: