pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Pedro Gimeno <pgsql-004@personal.formauri.es>
To: Tom Lane <tgl@sss.pgh.pa.us>
To: Josh Berkus <josh@agliodbs.com>
Cc: pgsql-bugs@postgresql.org
Subject: Re: Prepare/Execute silently discards prohibited ORDER BY values
Date: Thu, 14 May 2015 14:38:52 +0200
Message-ID: <5554975C.9060608@personal.formauri.es> (raw)
In-Reply-To: <13099.1431565504@sss.pgh.pa.us>
References: <555143EC.1000808@agliodbs.com>
	<432.1431389890@sss.pgh.pa.us>
	<WM!6984ef9fb6792db99b62da2924ab033eb5da5dabc38b4040b07eac1b3b45cb6c17d87576a6482595db04a8917c2d0f1e!@asav-2.01.com>
	<55514883.4000106@agliodbs.com>
	<5168.1431401736@sss.pgh.pa.us>
	<WM!7e757d929fe555ac6b71e9ef11ad8fa4397b616cac92ae45af4008c80cac7921630c4a4f6e170e6fef5bdc5099c7fd09!@asav-2.01.com>
	<5553F24B.8070009@agliodbs.com>
	<13099.1431565504@sss.pgh.pa.us>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

Tom Lane wrote, On 2015-05-14 03:05:
> 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.

If that helps, I don't think of that as violating the POLA
significantly. This is IMO a much worse violation:

=$ WITH test AS (SELECT 1 UNION ALL SELECT 0) SELECT * FROM test ORDER BY 1;
 ?column?
----------
        0
        1
(2 rows)

=$ WITH test AS (SELECT 1 UNION ALL SELECT 0) SELECT * FROM test ORDER
BY 1::integer;
 ?column?
----------
        1
        0
(2 rows)

especially since the latter ORDER BY clause is more likely to be the
result of a dumb automatic query generator that appends types to every
expression. But I, as an user, understand and accept that appending a
type changes the meaning of the ORDER BY.



-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



view thread (7+ messages)

Message-ID: <5554975C.9060608@personal.formauri.es>
Permalink:  ../5554975C.9060608@personal.formauri.es/
Also on:    postgresql.org/message-id/5554975C.9060608@personal.formauri.es

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: pgsql-004@personal.formauri.es, tgl@sss.pgh.pa.us, josh@agliodbs.com
  Subject: Re: Prepare/Execute silently discards prohibited ORDER BY values
  In-Reply-To: <5554975C.9060608@personal.formauri.es>
  References: <555143EC.1000808@agliodbs.com> <432.1431389890@sss.pgh.pa.us> <WM!6984ef9fb6792db99b62da2924ab033eb5da5dabc38b4040b07eac1b3b45cb6c17d87576a6482595db04a8917c2d0f1e!@asav-2.01.com> <55514883.4000106@agliodbs.com> <5168.1431401736@sss.pgh.pa.us> <WM!7e757d929fe555ac6b71e9ef11ad8fa4397b616cac92ae45af4008c80cac7921630c4a4f6e170e6fef5bdc5099c7fd09!@asav-2.01.com> <5553F24B.8070009@agliodbs.com> <13099.1431565504@sss.pgh.pa.us> <5554975C.9060608@personal.formauri.es>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox