Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by postgresql.org (Postfix) with ESMTP id A69574758A2 for ; Thu, 4 Apr 2002 12:03:18 -0500 (EST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.11.4/8.11.4) with ESMTP id g34H3MF24121; Thu, 4 Apr 2002 12:03:22 -0500 (EST) To: Bernd von den Brincken Cc: pgsql-sql@postgresql.org Subject: Re: Rvsd. / Re: Named column in a Function fails at ORDER BY (PgSQL 7.1) In-reply-to: <5.1.0.14.2.20020404020655.01cd3ea8@pop.kundenserver.de> References: <5.1.0.14.2.20020403211109.01cf5e40@pop.kundenserver.de> <5.1.0.14.2.20020403211109.01cf5e40@pop.kundenserver.de> <5.1.0.14.2.20020404020655.01cd3ea8@pop.kundenserver.de> Comments: In-reply-to Bernd von den Brincken message dated "Thu, 04 Apr 2002 02:28:18 +0200" Date: Thu, 04 Apr 2002 12:03:22 -0500 Message-ID: <24118.1017939802@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 200204/57 X-Sequence-Number: 7322 Bernd von den Brincken writes: >> SQL99 seems to have (incompatibly) redefined ORDER BY to allow >> expressions over the output column names, but I don't have a lot of >> appetite for breaking existing applications in order to conform to the >> SQL99 definition. > Would it really break existing applications it this syntax would be possible? Yes, it would. The main problem with defining ORDER BY in terms of output columns not input columns is that there is *no way* to write an ordering spec that involves data not explicitly presented to the user. This is such an obvious point that I can't believe the SQL99 committee missed it. Defining ORDER BY as they did does not create any functional benefit, it is only a way of avoiding writing the same expression twice --- but defining ORDER BY as we've historically done it offers a functional benefit that would be lost if we changed to the SQL99 interpretation. regards, tom lane