Re: alter table schema on 8.0.X

From: "Jim C(dot) Nasby" <jim(at)nasby(dot)net>
To: William Leite Ara?jo <william(dot)bh(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: alter table schema on 8.0.X
Date: 2005-12-02 23:22:20
Message-ID: 20051202232220.GU13642@nasby.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)pervasive(dot)com
Pervasive Software http://pervasive.com work: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf cell: 512-569-9461

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Jim C. Nasby 2005-12-02 23:37:28 Re: default_index_tablespace?
Previous Message Tom Lane 2005-12-02 23:06:25 Re: default_index_tablespace?