From: Stef <svb@ucs.co.za>
To: Stef <svb@ucs.co.za>
Cc: Andrew Sullivan <ajs@crankycanuck.ca>
Cc: pgsql-sql@postgresql.org
Subject: Re: Preserving column order when recreating table.
Date: Wed, 15 Sep 2004 17:07:00 +0200
Message-ID: <20040915170700.543722cf@svb.ucs.co.za> (raw)
In-Reply-To: <20040915162201.13be5102@svb.ucs.co.za>
References: <20040915142445.06b60e3e@svb.ucs.co.za>
<20040915131930.GA28290@phlogiston.dyndns.org>
<20040915162201.13be5102@svb.ucs.co.za>
Andrew mentioned :
=> Ugh. Sorry to say so, but this sounds to me really a lot like the
=> cure is worse than the disease. The answer to "Bob did something
=> incredibly stupid" is not "We'll bend ourselves into contortions to
=> support it." (This is not to say I don't sympathise. You wouldn't
=> believe how much I do.)
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)
=> and then rename the old table, rename the new table to the old table
=> name, and drop the old table if you like.
The only problem I've run into now, is duplicate index names. I think this
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?
Stef
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: svb@ucs.co.za, ajs@crankycanuck.ca
Subject: Re: Preserving column order when recreating table.
In-Reply-To: <20040915170700.543722cf@svb.ucs.co.za>
* 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