Re: Preserving column order when recreating table. - Mailing list pgsql-sql

From Andrew Sullivan
Subject Re: Preserving column order when recreating table.
Date
Msg-id 20040915153649.GB28600@phlogiston.dyndns.org
Whole thread Raw
In response to Re: Preserving column order when recreating table.  (Stef <svb@ucs.co.za>)
List pgsql-sql
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


pgsql-sql by date:

Previous
From: Stef
Date:
Subject: Re: Preserving column order when recreating table.
Next
From: Mike Rylander
Date:
Subject: Re: implementing an out-of-transaction trigger