Re: Move a table to another schema

Lee Kindness <lkindness@csl.co.uk>

From: Lee Kindness <lkindness@csl.co.uk>
To: Shridhar Daithankar <shridhar_daithankar@persistent.co.in>
Cc: Lee Kindness <lkindness@csl.co.uk>, pgsql-general@postgresql.org
Date: 2003-11-18T09:13:18Z
Lists: pgsql-general
Shridhar,

Shridhar Daithankar writes:
 > Lee Kindness wrote:
 > I have many tables created in the "public" schema and I would like to
 > migrate these into an "x001" schema. Unfortunately there is no ALTER
 > TABLE construct for this... The following SQL would seem to move the
 > "zxc" table from "public.zxc" to "x001.zxc":
 > 
 > Why not just rename the schema itself? You can recreate a public
 > schema later..:-)
 > 
 > Simple, isn't it? (Unless public is a specieal schema)

Thanks Shridhar - it's good when someone has a different angle on
things!

Of course I'm using 7.3, so there is no ALTER SCHEMA - but the
catalogue magic required to rename a single schema will be a lot less
than renaming 100s of tables, indices and views!

L.