Received: from sss2.sss.pgh.pa.us (sss.pgh.pa.us [209.114.166.2]) by hub.org (8.9.3/8.9.3) with ESMTP id SAA58707 for ; Fri, 26 May 2000 18:42:22 -0400 (EDT) (envelope-from tgl@sss.pgh.pa.us) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss2.sss.pgh.pa.us (8.9.3/8.9.3) with ESMTP id SAA03944; Fri, 26 May 2000 18:42:03 -0400 (EDT) To: Peter Eisentraut cc: Zeugswetter Andreas , pgsql-hackers@postgresql.org Subject: Re: Re: [SQL] aliases break my query In-reply-to: References: Comments: In-reply-to Peter Eisentraut message dated "Sat, 27 May 2000 00:30:14 +0200" Date: Fri, 26 May 2000 18:42:03 -0400 Message-ID: <3941.959380923@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 200005/702 Peter Eisentraut writes: >> "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. More or less obviously nonstandard, you mean. It's unlikely that either of those examples are incorrect in the sense of not doing what the user expected them to. If we were working in a green field then I'd agree that we ought to be 100% SQL-spec-compliant on this point. But as is, we are talking about rejecting an extension that Postgres has always had and a lot of people find useful. I'm not eager to do that; I think it'd be putting pedantry ahead of usefulness and backwards-compatibility. What I want to see is the minimum restriction that will catch likely errors, not an "I'll annoy you until you change your queries to meet the letter of the spec" kind of message. regards, tom lane