From: | "Jim C(dot) Nasby" <jim(at)nasby(dot)net> |
---|---|
To: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: RE : full featured alter table? |
Date: | 2003-06-16 17:00:49 |
Message-ID: | 20030616170049.GH40542@flake.decibel.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
On Mon, Jun 16, 2003 at 06:49:50PM +0200, Sven K?hler wrote:
> ALTER TABLE <table> ALTER COLUMN <column> POSITION <int i>
>
> where 1<=i<=number of cols in table and the given column will be moved
> between the (i-1)-th and the i-th column within the table.
I think that's fine. I think the normal case for doing this will be
after you've added a new column, I think it would be pretty rare to want
to re-order everything in the table. Of course if you did want to
re-order everything in the table, it would be easier to just specify the
list of column names in the new order you'd like to see them in.
> if a admin-tool wants to redefine the order of the columns, it just has
> to submit one command for every column with ascending positions.
BTW, I've heard a lot of people talking about 'dragging columns around
in select output', and I don't think that's a very good use case for
this. The order of columns should be considered to be part of the table
definition. Changing it should require the same privledges as adding or
dropping a column. If a front-end wants to provide some wiz-bang
interface customization on a per-user basis this isn't the mechanism
that should be used.
--
Jim C. Nasby (aka Decibel!) jim(at)nasby(dot)net
Member: Triangle Fraternity, Sports Car Club of America
Give your computer some brain candy! www.distributed.net Team #1828
Windows: "Where do you want to go today?"
Linux: "Where do you want to go tomorrow?"
FreeBSD: "Are you guys coming, or what?"
From | Date | Subject | |
---|---|---|---|
Next Message | Jim C. Nasby | 2003-06-16 17:03:27 | Re: Why can't you define a table alias on an update? |
Previous Message | Nigel J. Andrews | 2003-06-16 16:56:44 | Re: Excluding tables from pg_restore |