X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 34F883A3C55 for ; Tue, 16 Nov 2004 22:09:50 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 13799-07 for ; Tue, 16 Nov 2004 22:09:40 +0000 (GMT) Received: from smtp102.rog.mail.re2.yahoo.com (smtp102.rog.mail.re2.yahoo.com [206.190.36.80]) by svr1.postgresql.org (Postfix) with SMTP id F11ED3A4061 for ; Tue, 16 Nov 2004 22:09:40 +0000 (GMT) Received: from unknown (HELO phlogiston.dydns.org) (a.sullivan@rogers.com@65.49.125.184 with login) by smtp102.rog.mail.re2.yahoo.com with SMTP; 16 Nov 2004 22:09:38 -0000 Received: by phlogiston.dydns.org (Postfix, from userid 1000) id 7B315404D; Tue, 16 Nov 2004 17:09:37 -0500 (EST) Date: Tue, 16 Nov 2004 17:09:37 -0500 From: Andrew Sullivan To: pgsql-sql@postgresql.org Subject: Re: Move table between schemas Message-ID: <20041116220937.GA18023@phlogiston.dyndns.org> Mail-Followup-To: pgsql-sql@postgresql.org References: <20041116110538.GA15247@phlogiston.dyndns.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.6+20040722i X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200411/160 X-Sequence-Number: 19479 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