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


---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/users-lounge/docs/faq.html

Reply via email to