Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YshaL-0005jr-DG for pgsql-bugs@arkaria.postgresql.org; Thu, 14 May 2015 01:05:13 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1YshaK-0000g5-SL for pgsql-bugs@arkaria.postgresql.org; Thu, 14 May 2015 01:05:12 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1YshaJ-0000dQ-OP for pgsql-bugs@postgresql.org; Thu, 14 May 2015 01:05:11 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1YshaH-0004uE-8o for pgsql-bugs@postgresql.org; Thu, 14 May 2015 01:05:10 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id t4E154WI013100; Wed, 13 May 2015 21:05:04 -0400 From: Tom Lane To: Josh Berkus cc: pgsql-bugs@postgresql.org Subject: Re: Prepare/Execute silently discards prohibited ORDER BY values In-reply-to: <5553F24B.8070009@agliodbs.com> References: <555143EC.1000808@agliodbs.com> <432.1431389890@sss.pgh.pa.us> <55514883.4000106@agliodbs.com> <5168.1431401736@sss.pgh.pa.us> <5553F24B.8070009@agliodbs.com> Comments: In-reply-to Josh Berkus message dated "Wed, 13 May 2015 17:54:35 -0700" Date: Wed, 13 May 2015 21:05:04 -0400 Message-ID: <13099.1431565504@sss.pgh.pa.us> X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org Josh Berkus 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 -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs