Received: from merganser.its.uu.se (merganser.its.uu.se [130.238.6.236]) by hub.org (8.9.3/8.9.3) with ESMTP id SAA25818 for ; Fri, 26 May 2000 18:25:26 -0400 (EDT) (envelope-from peter@localhost.its.uu.se) Received: from regulus.student.UU.SE ([130.238.5.2]:51612 "EHLO regulus.its.uu.se") by merganser.its.uu.se with ESMTP id ; Sat, 27 May 2000 00:24:35 +0200 Received: from peter (helo=localhost) by regulus.its.uu.se with local-esmtp (Exim 3.02 #2) id 12vScQ-0000QH-00; Sat, 27 May 2000 00:30:14 +0200 Date: Sat, 27 May 2000 00:30:14 +0200 (CEST) From: Peter Eisentraut To: Tom Lane cc: Zeugswetter Andreas , pgsql-hackers@postgresql.org Subject: Re: Re: [SQL] aliases break my query In-Reply-To: <3661.959376868@sss.pgh.pa.us> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=ISO-8859-1 Content-Transfer-Encoding: 8BIT X-Archive-Number: 200005/701 Tom Lane writes: > "Zeugswetter Andreas" writes: > > I think we could get agreement to not allow implicit from entries > > if there is a from clause in the statement, but allow them if a from clause > > is missing altogether. That's what I had in mind. > "Emit a notice [or error if you insist] when an implicit FROM item is > added that refers to the same underlying table as any existing FROM > item." That's a step in the right direction, but I'd still like to catch SELECT a.a1, b.b1 FROM a; SELECT a.a1 FROM a WHERE a.a2 = b.b1; both of which are more or less obviously incorrect and easily fixed. > 95% of the complaints I can remember seeing were from people who got > confused by the behavior of "FROM table alias" combined with a reference > like "table.column". Seems to me the above rule would catch this case > without being obtrusive in the useful cases. Comments? -- Peter Eisentraut Sernanders väg 10:115 peter_e@gmx.net 75262 Uppsala http://yi.org/peter-e/ Sweden