Re: Case in Order By Ignored without warning or error - Mailing list pgsql-bugs

From David G. Johnston
Subject Re: Case in Order By Ignored without warning or error
Date
Msg-id CAKFQuwar3xN+1i8KcY-UYU7b4txjuufD4c-Bnj_OQyGL4RWs1Q@mail.gmail.com
Whole thread Raw
In response to Re: Case in Order By Ignored without warning or error  (Francisco Olarte <folarte@peoplecall.com>)
Responses Re: Case in Order By Ignored without warning or error  (Francisco Olarte <folarte@peoplecall.com>)
List pgsql-bugs
On Thu, Jun 9, 2016 at 10:58 AM, Francisco Olarte <folarte@peoplecall.com>
wrote:

> Hi Emiel:
>
> On Wed, Jun 8, 2016 at 1:31 PM, Emiel Hermsen <s32191234@gmail.com> wrote=
:
> > Understood. I did test the order by (a+b)+c with the statement: SELECT =
*
> > FROM films ORDER BY 1+1; which does not sort on the second column.
> Therefore
> > I assume that any construction like (a+b)+c will not work either.
>
> mmm, aybe you misnterpreted your test result, order by 1+1 correctly
> sorts by the expresion 1+1, =3D 2, so no sorting ( something that
> happens on underspecified sort criteria ). So a+b+c or othres should
> work too, as proven by 1+1. The problem is you thought 1+ select a
> column where only naked names and single numbers do. I think even '+1'
> does not do the same as '1'.
>
> > I do agree on your last statement about the difficulty.
> > My opinion in this matter is mostly based of my findings regarding the
> > "ORDER BY 1+1"  not doing anything.
>
> As before, it is doing a thing, sorting by a constant.
>
>
=E2=80=8BI think its a fair characterization to call "sorting on a constant=
" as
"doing nothing" or "not useful".  There is no noticeable difference between
that and omitting the constant.

David J.
=E2=80=8B

pgsql-bugs by date:

Previous
From: Francisco Olarte
Date:
Subject: Re: Case in Order By Ignored without warning or error
Next
From: hubert depesz lubaczewski
Date:
Subject: PostgreSQL (9.3 and 9.6) eats all memory when using many tables