Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 368DC475EB9 for ; Mon, 19 Aug 2002 04:01:03 -0400 (EDT) Received: from mta02-svc.ntlworld.com (mta02-svc.ntlworld.com [62.253.162.42]) by postgresql.org (Postfix) with ESMTP id 10E84475C7B for ; Mon, 19 Aug 2002 04:01:01 -0400 (EDT) Received: from Wilbur ([80.2.246.217]) by mta02-svc.ntlworld.com (InterMail vM.4.01.03.27 201-229-121-127-20010626) with SMTP id <20020819080101.ZQIR290.mta02-svc.ntlworld.com@Wilbur>; Mon, 19 Aug 2002 09:01:01 +0100 Message-ID: <06dc01c24756$9008f1a0$0500a8c0@Wilbur> From: "Julian Scarfe" To: "Tom Lane" Cc: References: <046401c246ad$48dbdc10$0500a8c0@Wilbur> <1115.1029700538@sss.pgh.pa.us> Subject: Re: Ordering with GROUPs Date: Mon, 19 Aug 2002 09:01:02 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200208/263 X-Sequence-Number: 9109 From: "Tom Lane" > ISTM the problem here is the lack of any ordering operator for POINT, > which defeats GROUP BY, *plus* the lack of any aggregate you might use > for an aggregate-based solution. This is not really a language failing > but a problem with an impoverished datatype. Yes, I agree completely. If I were doing this again from scratch I'd be using PostGIS, but I've got a lot of data that depends on POINT. > So, if you don't like > Bruno's subselect-based workaround, the dummy aggregate seems the way > to go. I've actually implemented the dummy aggregate now, and it works fine. So does Bruno's subselect (thank you Bruno), and the efficiency seems to be similar in each case. > SQL99 contains a whole bunch of verbiage whose intent seems to be that > if you GROUP BY a unique or primary-key column, you can reference the > other columns of that table without aggregation (essentially, the > system treats them as implicitly GROUP BY'd). Sooner or later we'll > probably get around to implementing that, and that would solve your > problem as long as you declare location.ident properly. That makes a lot of sense, though I imagine there are higher priorities. Thanks for your help. Julian Scarfe