Re: inconsistency in aliasing - Mailing list pgsql-general

From Scott Marlowe
Subject Re: inconsistency in aliasing
Date
Msg-id dcc563d10901140341i7fe771eel85863482285378e@mail.gmail.com
Whole thread Raw
In response to inconsistency in aliasing  (Louis-David Mitterrand <vindex+lists-pgsql-general@apartia.org>)
List pgsql-general
On Wed, Jan 14, 2009 at 3:46 AM, Louis-David Mitterrand
<vindex+lists-pgsql-general@apartia.org> wrote:
> Hi,
>
> This works:
>
>        critik=# select current_timestamp::abstime::int4 as score order by score;
>
> This doesn't:
>
>        critik=# select current_timestamp::abstime::int4 as score order by score + 1;
>        ERROR:  column "score" does not exist
>        LINE 1: ...urrent_timestamp::abstime::int4 as score order by score + 1 ...

A number in an order by refers to a column.

select a, b, c/d as f from table order by 3;

will order by the third field in the select list.  I'm guessing the +
1 is trying to add col 1 to a field it can't find.  doubt it's a bug,
more like a quirk.

pgsql-general by date:

Previous
From: "A. Kretschmer"
Date:
Subject: Re: inconsistency in aliasing
Next
From: Emanuel Calvo Franco
Date:
Subject: Re: [ADMIN] Problem with pg_dump