From: Tom Lane <tgl@sss.pgh.pa.us>
To: Peter Eisentraut <peter_e@gmx.net>
Cc: Zeugswetter Andreas <andreas.zeugswetter@telecom.at>
Cc: pgsql-hackers@postgresql.org
Subject: Re: Re: [SQL] aliases break my query
Date: Fri, 26 May 2000 18:42:03 -0400
Message-ID: <3941.959380923@sss.pgh.pa.us> (raw)
In-Reply-To: <Pine.LNX.4.21.0005270026540.348-100000@localhost.localdomain>
References: <Pine.LNX.4.21.0005270026540.348-100000@localhost.localdomain>
Peter Eisentraut <peter_e@gmx.net> 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
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: tgl@sss.pgh.pa.us, peter_e@gmx.net, andreas.zeugswetter@telecom.at, pgsql-hackers@postgresql.org
Subject: Re: [SQL] aliases break my query
In-Reply-To: <3941.959380923@sss.pgh.pa.us>
References: <Pine.LNX.4.21.0005270026540.348-100000@localhost.localdomain> <3941.959380923@sss.pgh.pa.us>
* 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