From: Andrew Sullivan <ajs@crankycanuck.ca>
To: pgsql-sql@postgresql.org
Subject: Re: Move table between schemas
Date: Tue, 16 Nov 2004 17:09:37 -0500
Message-ID: <20041116220937.GA18023@phlogiston.dyndns.org> (raw)
In-Reply-To: <Pine.LNX.4.44.0411161429410.5420-100000@matrix.gatewaynet.com>
References: <20041116110538.GA15247@phlogiston.dyndns.org>
<Pine.LNX.4.44.0411161429410.5420-100000@matrix.gatewaynet.com>
On Tue, Nov 16, 2004 at 02:30:09PM +0200, Achilleus Mantzios wrote:
> >
> > CREATE TABLE newschema.newtable AS SELECT * FROM oldschema.oldtable
> >
> > oughta work.
>
> What about indexes, constraints, sequences,etc...???
You'll have to create those too, I'm afraid. I don't know of a way
to move tables from one schema to another otherwise. You could do
all the dependencies with a pg_dump -t, I suspect. Not tested that,
though.
A
--
Andrew Sullivan | ajs@crankycanuck.ca
A certain description of men are for getting out of debt, yet are
against all taxes for raising money to pay it off.
--Alexander Hamilton
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: ajs@crankycanuck.ca
Subject: Re: Move table between schemas
In-Reply-To: <20041116220937.GA18023@phlogiston.dyndns.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox