Re: Add Column BEFORE/AFTER another column - Mailing list pgsql-general

From Erik Jones
Subject Re: Add Column BEFORE/AFTER another column
Date
Msg-id 817BF6D1-2C4E-41E7-9D42-36FD32EE12A5@myemma.com
Whole thread Raw
In response to Re: Add Column BEFORE/AFTER another column  (Matthew <mboehm@voilaip.com>)
Responses Re: Add Column BEFORE/AFTER another column  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
On Aug 24, 2007, at 4:18 PM, Matthew wrote:

> Hey Bill,
>
>> It does not.
>
>     Bummer.
>
>> To get your columns in a specific order, specify the column names in
>> that order in your SELECT statement.  The SQL standard doesn't
>> provide
>> for any other way to guarantee column order, and neither does
>> Postgres.
>
>     Yes, I realize this and we do identify our columns during select
> statements, but when you look at a table using a tool like
> phpPGAdmin or
> pgAdmin3, the columns are displayed in some defined order.  It's much
> easier to see your data/columns in some logical order (ie: all the
> cost
> columns next to each other).

PHP, eh?  Do you know it?  Given that Postgres doesn't provide that
convenience, perhaps you could add the functionality to phpPGAdmin.
It is open source.  If you're not up on PHP or, well, just don't feel
like it, make a feature request there.  Believe me, it's already been
made here.  The usual answer, or argument against, is because the
standard dictates that the order of attributes in rows returned by
queries is undefined in the absence a specified (in the query) ordering.

Although it occurs to me that, while that answer is correct and
justified, that's not the answer to what most people actually want.
What they want is that when they look at a table they see a
particular order.  Has anybody suggested or discussed adding an
optional view, or description, ordering table meta-attribute?


pgsql-general by date:

Previous
From: "Stuart"
Date:
Subject: Re: connect by service name in psql
Next
From: Benjamin Arai
Date:
Subject: Re: [PERFORM] Partioning tsearch2 a table into chunks and accessing via views