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

From Francisco Olarte
Subject Re: Case in Order By Ignored without warning or error
Date
Msg-id CA+bJJbyX8ieLQ6FZkdbaji2z3uWXCSfz-B4thc5TWGNYZUYmEw@mail.gmail.com
Whole thread Raw
In response to Re: Case in Order By Ignored without warning or error  (Emiel Hermsen <s32191234@gmail.com>)
Responses Re: Case in Order By Ignored without warning or error  ("David G. Johnston" <david.g.johnston@gmail.com>)
List pgsql-bugs
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, = 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.


Francisco Olarte.

pgsql-bugs by date:

Previous
From: Peter Geoghegan
Date:
Subject: Re: BUG #14150: Attempted to delete invisible tuple
Next
From: "David G. Johnston"
Date:
Subject: Re: Case in Order By Ignored without warning or error