Re: Reordering columns in a table

From: John McCawley <nospam(at)hardgeus(dot)com>
To: Andreas Kretschmer <akretschmer(at)spamfence(dot)net>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Reordering columns in a table
Date: 2006-01-06 19:41:15
Message-ID: 43BEC7DB.9070108@hardgeus.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-general

OK, one last question on the subject and I'll shut up. 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.?

Andreas Kretschmer wrote:

>John McCawley <nospam(at)hardgeus(dot)com> schrieb:
>
>
>>However, in the real world, columns are often added willy-nilly as they are
>>needed, and it is not immediately obvious which, if any, of the columns
>>will be related. Later, solely for visual clarity, it is desirable to have
>>the ability to reorder the columns in the database. I wouldn't depend on
>>
>>
>
>I understand you, but i repeat Joshua and Berend: PostgreSQL hasn't a
>build-in solution for this.
>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.
>
>
>HTH, Andreas, and sorry for my bad english
>
>

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Jim C. Nasby 2006-01-06 19:43:30 Re: BUG #2150: PL/Python function delcared STABLE gets run repeatedly
Previous Message Andreas Kretschmer 2006-01-06 19:39:59 Re: Reordering columns in a table

Browse pgsql-general by date

  From Date Subject
Next Message Berend Tober 2006-01-06 19:45:01 Re: Reordering columns in a table
Previous Message Andreas Kretschmer 2006-01-06 19:39:59 Re: Reordering columns in a table