pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Peter Eisentraut <peter_e@gmx.net>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Zeugswetter Andreas <andreas.zeugswetter@telecom.at>
Cc: pgsql-hackers@postgresql.org
Subject: Re: Re: [SQL] aliases break my query
Date: Sat, 27 May 2000 00:30:14 +0200 (CEST)
Message-ID: <Pine.LNX.4.21.0005270026540.348-100000@localhost.localdomain> (raw)
In-Reply-To: <3661.959376868@sss.pgh.pa.us>

Tom Lane writes:

> "Zeugswetter Andreas" <andreas.zeugswetter@telecom.at> 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




view thread (15+ messages)  latest in thread

Message-ID: <Pine.LNX.4.21.0005270026540.348-100000@localhost.localdomain>
Permalink:  ../Pine.LNX.4.21.0005270026540.348-100000@localhost.localdomain/
Also on:    postgresql.org/message-id/Pine.LNX.4.21.0005270026540.348-100000@localhost.localdomain

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: peter_e@gmx.net, tgl@sss.pgh.pa.us, andreas.zeugswetter@telecom.at, pgsql-hackers@postgresql.org
  Subject: Re: [SQL] aliases break my query
  In-Reply-To: <Pine.LNX.4.21.0005270026540.348-100000@localhost.localdomain>
  References: <3661.959376868@sss.pgh.pa.us> <Pine.LNX.4.21.0005270026540.348-100000@localhost.localdomain>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox