=?iso-8859-15?q?Herv=E9=20Piedvache?= <herve@elma.fr> writes:
> Is it an example more realistic for you to make an order by lower of
> something as an alias ?
Aliases attached to SELECT output columns are visible outside the
SELECT, not inside it. The special case for ORDER BY simple-column-name
is a kluge for compatibility with a now-obsolete version of the SQL spec
(SQL92 expects this to work, SQL99 doesn't) and we aren't going to
extend it. See past discussions in the archives (I seem to recall
answering this same question within the past week...)
regards, tom lane