Re: Reordering columns in a table - Mailing list pgsql-general

From Ian Harding
Subject Re: Reordering columns in a table
Date
Msg-id 725602300601061934i61219371vb7dddb0be1ea868@mail.gmail.com
Whole thread Raw
In response to Re: Reordering columns in a table  (Scott Ribe <scott_ribe@killerbytes.com>)
Responses Re: Reordering columns in a table  (Robert Treat <xzilla@users.sourceforge.net>)
List pgsql-general
As I recall, the MS SQL Server draggy droppy diagrammer tool made it
seem trivial to rearrange columns did the same thing.  It just
generated SQL statements to:

Begin transaction
select data in new order into a new table
drop dependent objects
drop old table
rename new table
re-create dependent objects
end transaction

It seemed kinda squirrelly to me, but it worked most of the time since
MSSQL Server had a good dependency tracking thingie.  However, I would
not really call it a feature of the DBMS.  I would call it a bolted on
utility.

On 1/6/06, Scott Ribe <scott_ribe@killerbytes.com> wrote:
> > I would assume
> > that all dependent database objects are also dropped when you drop the
> > table, so you'd have to recreate all of your foreign keys (both
> > directions) and triggers etc.?
>
> Basically. I try to keep my DDL scripts organized in a way that makes this
> easy. Of course an automated tool could do this as well. For instance I used
> to use the products from Embarcadero to maintain Sybase databases, and their
> design tool would create all the DDL needed to update a live database to
> match the current design. Of course, one experience with a bug and I learned
> to have it show me the script and read it carefully before proceeding ;-)
> (Hey, I'm not stupid, it was just a development db that I hosed!)
>
>
> --
> Scott Ribe
> scott_ribe@killerbytes.com
> http://www.killerbytes.com/
> (303) 665-7007 voice
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: Don't 'kill -9' the postmaster
>

pgsql-general by date:

Previous
From: Stephen Frost
Date:
Subject: Re: Drop user doesn't drop granted privs?
Next
From: Michael Fuhr
Date:
Subject: Re: plpgsql question