Re: column order - Mailing list pgsql-general

From Michael Glaesemann
Subject Re: column order
Date
Msg-id D2AB135B-BF96-472F-842C-766ACA657B37@seespotcode.net
Whole thread Raw
In response to Re: column order  ("Florian G. Pflug" <fgp@phlo.org>)
List pgsql-general
On May 24, 2006, at 22:36 , Florian G. Pflug wrote:

> Michael Glaesemann wrote:
>> On May 24, 2006, at 11:54 , nuno wrote:
>>> does postgresql guarantee you that
>>> the columns in the result set would be ordered
>>> as specified in the query (i.e. id, firstname, lastname, dob) ?
>> No. If you want a specific order, use the ORDER BY clause.
> I think the OP was talking about the order by the _columns_, not
> the _rows_.
>
> Postgres guarantees that order - Anything else would be simply insane.

Wow. I didn't even consider that's what was being asked. (Does that
make me sane?) I had assumed he mean the rows would be ordered in the
order of the columns. For example,

select foo, bar, baz
from blurfl

would be (by default) equivalent to

select foo, bar, baz
from blurfl
order by foo, bar, baz.

Thanks, Florian (and Andreas) for the sanity check. (Still haven't
heard back from the OP though.)


Michael Glaesemann
grzm seespotcode net




pgsql-general by date:

Previous
From: Joel Alejandro Espinosa Carra
Date:
Subject: Re: JDBC issue
Next
From: TJ O'Donnell
Date:
Subject: recompliing c-language functions with new releases of postgres