Re: alter table schema on 8.0.X - Mailing list pgsql-general

From Jim C. Nasby
Subject Re: alter table schema on 8.0.X
Date
Msg-id 20051202232220.GU13642@nasby.net
Whole thread Raw
In response to alter table schema on 8.0.X  (William Leite Araújo <william.bh@gmail.com>)
List pgsql-general
On Thu, Dec 01, 2005 at 10:25:48AM -0200, William Leite Ara?jo wrote:
>      Hi, I'm trying alter a table schema on 'PostgreSQL 8.0.2 on
> i686-pc-linux-gnu, compiled by GCC gcc (GCC) 3.3.5 (Debian 1:3.3.5-5)'.
>      On 8.1, by documentation, has the commant "ALTER TABLE <table> SET
> SCHEMA <new_schema>". Any solution for this in 8.0?
>
>
> Ps.: solutions different of "CREATE TABLE <new_schema.table> as SELECT *
> FROM schema.table" please.
>
> --
> William Leite Ara?jo

Theoretically, you can do this manually, but there's a number of things
you need to look at. Your best bet is to read through
AlterTableNamespace in
http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/commands/tablecmds.c?rev=1.176
and see what it's doing.

It's always a bit dangerous mucking about with the system catalogs, so I
wouldn't recommend this for a production system.

If you do code up something that takes all those tables into account
it'd be good to share it with the community. If nothing else, one of the
core coders might tell you how risky it actually is.
--
Jim C. Nasby, Sr. Engineering Consultant      jnasby@pervasive.com
Pervasive Software      http://pervasive.com    work: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf       cell: 512-569-9461

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: default_index_tablespace?
Next
From: "Jim C. Nasby"
Date:
Subject: Re: default_index_tablespace?