On Wed, Sep 15, 2004 at 02:24:45PM +0200, Stef wrote:
> I'm struggling with a situation where I
> want to recreate a table (in more than 30 databases) to
> fix the column order (attnum sequence) and in another case,
> fix different definitions for the same column in a table e.g.
> amount numeric(16,2)
> in stead of :
> amount numeric(16,5)
I'm not sure why you want to do the former, but in any case, it's
possible by creating a new table which has things the way you want;
select all the old data from the old table into the new table (using
the column names to get everything in the order you like, of course),
and then rename the old table, rename the new table to the old table
name, and drop the old table if you like.
Andrew Sullivan | ajs(at)crankycanuck(dot)ca
The fact that technology doesn't work is no bar to success in the marketplace.
In response to
pgsql-sql by date
|Next:||From: Stef||Date: 2004-09-15 14:22:01|
|Subject: Re: Preserving column order when recreating table.|
|Previous:||From: Stef||Date: 2004-09-15 12:24:45|
|Subject: Preserving column order when recreating table.|