Re: ALTER TABLE schema SCHEMA TO new_schema? - Mailing list pgsql-hackers

From Tom Lane
Subject Re: ALTER TABLE schema SCHEMA TO new_schema?
Date
Msg-id 15899.1038721673@sss.pgh.pa.us
Whole thread Raw
In response to ALTER TABLE schema SCHEMA TO new_schema?  (Joe Conway <mail@joeconway.com>)
Responses Re: ALTER TABLE schema SCHEMA TO new_schema?
Re: ALTER TABLE schema SCHEMA TO new_schema?
List pgsql-hackers
Joe Conway <mail@joeconway.com> writes:
> 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=# 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 didn't fix the pg_depend entries linking the table to its schema :-(

> But it made me wonder if we shouldn't have:
>    ALTER TABLE table SCHEMA TO new_schema

I was thinking more along the lines of ALTER TABLE a.b RENAME TO x.y

I don't see anything in the SQL spec about this; anyone know what
precedent is in Oracle or other DBMSes?
        regards, tom lane


pgsql-hackers by date:

Previous
From: Joe Conway
Date:
Subject: ALTER TABLE schema SCHEMA TO new_schema?
Next
From: Tom Lane
Date:
Subject: Re: 7.4 Wishlist