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 AA7D1329C6B for ; Wed, 15 Sep 2004 16:36:56 +0100 (BST) 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 78255-10 for ; Wed, 15 Sep 2004 15:36:52 +0000 (GMT) Received: from smtp105.rog.mail.re2.yahoo.com (smtp105.rog.mail.re2.yahoo.com [206.190.36.83]) by svr1.postgresql.org (Postfix) with SMTP id 5FFB0329EAF for ; Wed, 15 Sep 2004 16:36:51 +0100 (BST) Received: from unknown (HELO phlogiston.dydns.org) (a.sullivan@rogers.com@65.49.125.184 with login) by smtp105.rog.mail.re2.yahoo.com with SMTP; 15 Sep 2004 15:36:50 -0000 Received: by phlogiston.dydns.org (Postfix, from userid 1000) id 5FB3C40E4; Wed, 15 Sep 2004 11:36:49 -0400 (EDT) Date: Wed, 15 Sep 2004 11:36:49 -0400 From: Andrew Sullivan To: pgsql-sql@postgresql.org Subject: Re: Preserving column order when recreating table. Message-ID: <20040915153649.GB28600@phlogiston.dyndns.org> Mail-Followup-To: pgsql-sql@postgresql.org References: <20040915142445.06b60e3e@svb.ucs.co.za> <20040915131930.GA28290@phlogiston.dyndns.org> <20040915162201.13be5102@svb.ucs.co.za> <20040915170700.543722cf@svb.ucs.co.za> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040915170700.543722cf@svb.ucs.co.za> 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: 200409/110 X-Sequence-Number: 18956 On Wed, Sep 15, 2004 at 05:07:00PM +0200, Stef wrote: > Funny you say. It looks like "Bob" had a hand in pg_dump -d , 'cause I've > many times wished there were column names specified there, too :) > (I'm talking Prior 7.4 here, dunno if it's changed already) Dunno about previous, but pg_dump -D does what you want. I think the -d switch did it this way because you can get away with that if you're also creating the schema in the same breath. I agree that "Bob's" fingers have left their grotty marks in plenty of places. > is why I didn't use this solution originally. But I figured out a way to > modify pieces of the "create table" statement to drop all the indexes > and constraints first. > > Is there an easier way around this? I doubt it. A -- Andrew Sullivan | ajs@crankycanuck.ca The plural of anecdote is not data. --Roger Brinner