Re: Add Column BEFORE/AFTER another column

From: Erik Jones <erik(at)myemma(dot)com>
To: Matthew <mboehm(at)voilaip(dot)com>
Cc: Bill Moran <wmoran(at)potentialtech(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: Add Column BEFORE/AFTER another column
Date: 2007-08-25 04:38:26
Message-ID: 817BF6D1-2C4E-41E7-9D42-36FD32EE12A5@myemma.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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?

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Benjamin Arai 2007-08-25 05:34:06 Re: [PERFORM] Partioning tsearch2 a table into chunks and accessing via views
Previous Message Brandon Shalton 2007-08-25 03:54:24 Re: [PERFORM] Partioning tsearch2 a table into chunks and accessing via views