pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Julian Scarfe <julian.scarfe@ntlworld.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-sql@postgresql.org
Subject: Re: Ordering with GROUPs
Date: Mon, 19 Aug 2002 09:01:02 +0100
Message-ID: <06dc01c24756$9008f1a0$0500a8c0@Wilbur> (raw)
References: <046401c246ad$48dbdc10$0500a8c0@Wilbur>
	<1115.1029700538@sss.pgh.pa.us>

From: "Tom Lane" <tgl@sss.pgh.pa.us>

> 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





view thread (4+ messages)

Message-ID: <06dc01c24756$9008f1a0$0500a8c0@Wilbur>
Permalink:  ../06dc01c24756$9008f1a0$0500a8c0@Wilbur/
Also on:    postgresql.org/message-id/06dc01c24756$9008f1a0$0500a8c0@Wilbur

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: julian.scarfe@ntlworld.com, tgl@sss.pgh.pa.us
  Subject: Re: Ordering with GROUPs
  In-Reply-To: <06dc01c24756$9008f1a0$0500a8c0@Wilbur>

* 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