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

From Berend Tober
Subject Re: Reordering columns in a table
Date
Msg-id 43BEC8BD.2020908@seaworthysys.com
Whole thread Raw
In response to Re: Reordering columns in a table  (Andreas Kretschmer <akretschmer@spamfence.net>)
List pgsql-general
Andreas Kretschmer wrote:

>John McCawley <nospam@hardgeus.com> schrieb:
>
>
>>However, in the real world, ...
>>
>>
>
>...And i think, other systems do this:
>
>- begin
>- create a new temp. table with the new order
>- insert all values from the old table in the new temp. table
>- drop the old table
>- rename the temp. table to the old table name
>- commit
>
>You can do the same, no problem.
>
>
>

Except for the details regarding dependent views and foreign key
references... (as someone mentioned mentioned earlier!). And you
probably wouldn't want to do that on an in-production system, I would
think, although the transaction block prehaps provides appropriate
protection.

Regards,
Berend Tober



pgsql-general by date:

Previous
From: John McCawley
Date:
Subject: Re: Reordering columns in a table
Next
From: Wes
Date:
Subject: ./configure --with-openssl=path fails