Re: Prepare/Execute silently discards prohibited ORDER BY values - Mailing list pgsql-bugs

From Tom Lane
Subject Re: Prepare/Execute silently discards prohibited ORDER BY values
Date
Msg-id 13099.1431565504@sss.pgh.pa.us
Whole thread Raw
In response to Re: Prepare/Execute silently discards prohibited ORDER BY values  (Josh Berkus <josh@agliodbs.com>)
Responses Re: Prepare/Execute silently discards prohibited ORDER BY values  (Pedro Gimeno <pgsql-004@personal.formauri.es>)
List pgsql-bugs
Josh Berkus <josh@agliodbs.com> writes:
> On 05/11/2015 08:35 PM, Tom Lane wrote:
>> Somewhere along the line we decided that "ORDER BY non-integer-constant"
>> was too close to the boundary line between those two interpretations, so
>> it would be better to reject it and make you use a less ambiguous syntax.

> Well, the fact that:
> ORDER BY 'test'
> ... errrors, whereas
> ORDER BY 'test'::TEXT
> ... does not is a very small POLS violation.

Agreed; I think the reason why we disallow this case is not so much
string literals as numeric literals.  It would be an even bigger POLA
violation if "ORDER BY 1" and "ORDER BY 1.0" were both accepted and did
fundamentally different things.

            regards, tom lane

pgsql-bugs by date:

Previous
From: Josh Berkus
Date:
Subject: Re: Prepare/Execute silently discards prohibited ORDER BY values
Next
From: maxim.boguk@gmail.com
Date:
Subject: BUG #13286: Core dumped during pg_terminate_backend call.