Re: column order

From: Michael Glaesemann <grzm(at)seespotcode(dot)net>
To: Florian G(dot) Pflug <fgp(at)phlo(dot)org>
Cc: nuno <wegein(at)gmail(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: column order
Date: 2006-05-24 22:12:28
Message-ID: D2AB135B-BF96-472F-842C-766ACA657B37@seespotcode.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message TJ O'Donnell 2006-05-24 22:43:10 recompliing c-language functions with new releases of postgres
Previous Message Joel Alejandro Espinosa Carra 2006-05-24 21:01:57 Re: JDBC issue