X-Original-To: pgsql-sql@postgresql.org Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 547F1474E42 for ; Sun, 23 Feb 2003 15:03:32 -0500 (EST) Received: from postgresql.org ([64.49.215.8]) by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with SMTP id 12566-03 for ; Sun, 23 Feb 2003 15:03:21 -0500 (EST) Received: from davinci.ethosmedia.com (unknown [209.10.40.251]) by postgresql.org (Postfix) with ESMTP id B93A6475A4B for ; Sun, 23 Feb 2003 15:00:20 -0500 (EST) Received: from [63.195.55.98] (HELO spooky) by davinci.ethosmedia.com (CommuniGate Pro SMTP 4.0.2) with ESMTP id 2853747; Sun, 23 Feb 2003 12:00:20 -0800 Content-Type: text/plain; charset="iso-8859-1" From: Josh Berkus Organization: Aglio Database Solutions To: Peter Eisentraut Subject: Re: 7.3 "group by" issue Date: Sun, 23 Feb 2003 11:59:35 -0800 User-Agent: KMail/1.4.3 Cc: Dan Langille , Chad Thompson , References: In-Reply-To: MIME-Version: 1.0 Message-Id: <200302231159.35826.josh@agliodbs.com> Content-Transfer-Encoding: quoted-printable X-Virus-Scanned: by amavisd-new X-Archive-Number: 200302/511 X-Sequence-Number: 11909 Peter, > Consider JOIN to be a black-box function, then you'd be writing something > like > > SELECT a.c1, count(a.c2) > FROM func(a, b) AS r (c1, c2, c3, c4, c5) > WHERE b.c5 =3D x > GROUP BY c1; -- <=3D=3D refers to r.c1 > > Clearly in this case you cannot claim that in general a.c1 =3D=3D r.c1. > > If the func() is an inner join, then the claim is true, but if it's an > outer join it's not. The scoping rules for inner and outer joins are the > same, and that might be considered a good thing. I see what you mean ... though I still hold that it's an implementation iss= ue,=20 rather than a theory one. That is, a human can easily tell the difference= s=20 when differently qualified table names are exactly equivalent even if a=20 parser cannot.=20=20 But I can definitely see where trying to accomodate this would be doing a= =20 *lot* of programming to support sloppy syntax in a rather limited number of= =20 useful cases. More on BUGS --=20 Josh Berkus Aglio Database Solutions San Francisco