Re: Reordering columns in a table

From: Berend Tober <btober(at)seaworthysys(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Reordering columns in a table
Date: 2006-01-06 19:45:01
Message-ID: 43BEC8BD.2020908@seaworthysys.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-general

Andreas Kretschmer wrote:

>John McCawley <nospam(at)hardgeus(dot)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

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2006-01-06 19:48:59 Re: BUG #2150: PL/Python function delcared STABLE gets run repeatedly
Previous Message Jim C. Nasby 2006-01-06 19:43:30 Re: BUG #2150: PL/Python function delcared STABLE gets run repeatedly

Browse pgsql-general by date

  From Date Subject
Next Message Wes 2006-01-06 19:50:25 ./configure --with-openssl=path fails
Previous Message John McCawley 2006-01-06 19:41:15 Re: Reordering columns in a table