Received: from gandalf.it-austria.net (gandalf.it-austria.net [213.150.1.65]) by hub.org (8.9.3/8.9.3) with ESMTP id DAA20438 for ; Sun, 28 May 2000 03:53:40 -0400 (EDT) (envelope-from andreas.zeugswetter@telecom.at) Received: from zeus (totalctlh1-port016.f000.d0188.sd.spardat.at [10.8.35.239]) by gandalf.it-austria.net (xxx/xxx) with SMTP id JAA131402; Sun, 28 May 2000 09:52:57 +0200 From: Andreas Zeugswetter To: Tom Lane Subject: Re: Re: [SQL] aliases break my query Date: Sun, 28 May 2000 09:34:40 +0200 X-Mailer: KMail [version 1.0.29.1] Content-Type: text/plain Cc: pgsql-hackers@postgresql.org References: <002601bfc74b$3fda29c0$f823080a@sd.spardat.at> <3661.959376868@sss.pgh.pa.us> In-Reply-To: <3661.959376868@sss.pgh.pa.us> MIME-Version: 1.0 Message-Id: <00052809405405.00145@zeus> Content-Transfer-Encoding: 8bit X-Archive-Number: 200005/745 On Fri, 26 May 2000, Tom Lane wrote: > "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? I guess I would be more strict on the reason, that people playing with implicit from entries usually know what they are doing, and thus know how to avoid a from clause if they want that behavior. I don't see a reason to have one table in the from clause but not another. This is too misleading for me. Andreas