Re: Case in Order By Ignored without warning or error

From: Francisco Olarte <folarte(at)peoplecall(dot)com>
To: Emiel Hermsen <s32191234(at)gmail(dot)com>
Cc: "pgsql-bugs(at)postgresql(dot)org" <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: Case in Order By Ignored without warning or error
Date: 2016-06-09 14:58:04
Message-ID: CA+bJJbyX8ieLQ6FZkdbaji2z3uWXCSfz-B4thc5TWGNYZUYmEw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Hi Emiel:

On Wed, Jun 8, 2016 at 1:31 PM, Emiel Hermsen <s32191234(at)gmail(dot)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.

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message David G. Johnston 2016-06-09 15:15:58 Re: Case in Order By Ignored without warning or error
Previous Message Peter Geoghegan 2016-06-08 22:37:18 Re: BUG #14150: Attempted to delete invisible tuple