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 16:00:30
Message-ID: 43BE941E.3090809@seaworthysys.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-general

John McCawley wrote:

> Is there a way to change the order of columns in a table in Postgres
> after it has been created? ...

The best way to do it is when you have the opportunity to do a restore,
edit the pg_dump output between the dump and the restore steps. There
are other approaches that might not be feasible depending on
circumstances, like dropping and recreating the table and reloading
data, but you have to deal with foreign key and other dependencies and
so it is probably more work than justifiable for something that makes no
practical difference.

Regards,
Berend Tober

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message A. Kretschmer 2006-01-06 16:07:35 Re: Reordering columns in a table
Previous Message Joshua D. Drake 2006-01-06 15:55:36 Re: Reordering columns in a table

Browse pgsql-general by date

  From Date Subject
Next Message Joe Conway 2006-01-06 16:04:13 Re: Arrays and Performance
Previous Message Daniel Kunkel 2006-01-06 15:59:06 Re: Adding another primary key to a populated table