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 RAA31076 for ; Fri, 26 May 2000 17:34:49 -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 RAA03664; Fri, 26 May 2000 17:34:28 -0400 (EDT) To: "Zeugswetter Andreas" cc: pgsql-hackers@postgresql.org Subject: Re: Re: [SQL] aliases break my query In-reply-to: <002601bfc74b$3fda29c0$f823080a@sd.spardat.at> References: <2392.959358366@sss.pgh.pa.us> <002601bfc74b$3fda29c0$f823080a@sd.spardat.at> Comments: In-reply-to "Zeugswetter Andreas" message dated "Fri, 26 May 2000 21:47:38 +0200" Date: Fri, 26 May 2000 17:34:28 -0400 Message-ID: <3661.959376868@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 200005/700 "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. The patch did not distinguish the two cases. Hmm, that's a thought. Taking it a little further, how about this: "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." 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? regards, tom lane