Received: from sss.pgh.pa.us (sss.pgh.pa.us [209.114.132.154]) by hub.org (8.10.1/8.10.1) with ESMTP id e96LNjJ27145 for ; Fri, 6 Oct 2000 17:23:45 -0400 (EDT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.11.0/8.11.0) with ESMTP id e96LNhB05082; Fri, 6 Oct 2000 17:23:43 -0400 (EDT) To: "Josh Berkus" cc: pgsql-sql@postgresql.org Subject: Re: Re: [HACKERS] Counting bool flags in a complex query In-reply-to: References: Comments: In-reply-to "Josh Berkus" message dated "Fri, 06 Oct 2000 09:31:44 -0700" Date: Fri, 06 Oct 2000 17:23:43 -0400 Message-ID: <5079.970867423@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 200010/78 "Josh Berkus" writes: >> Just FYI, I have committed code for 7.1 that allows ORDER BY to work >> correctly for a UNION'd query. A limitation is that you can only do >> ordering on columns that are outputs of the UNION: > As far as I know, that limitation is standard to all SQL > that supports UNION; the relational calculus (I'm told) is > impossible otherwise. It's not very reasonable to imagine ordering on arbitrary expressions; how would you interpret the expression in each sub-SELECT? But it's reasonable to imagine ordering on expressions that use only the output columns of the UNION-type query: SELECT q1, q2 FROM tbl1 UNION SELECT ... ORDER BY q1+q2; However, I didn't try to implement this yet. > So ... we keep hearing about all the fantastic fixes in 7.1. > When will a stable build show up? :-) How stable is stable? I'd say it's plenty stable enough for beta testing now, even though we're not putting out formal beta releases quite yet. You could grab a nightly snapshot off the FTP server if you want to try it. (Beware that you will most likely have to do another initdb before beta, so loading lots and lots of data into a snapshot installation is probably a waste of time.) regards, tom lane