Re: Re: [SQL] aliases break my query

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Re: [SQL] aliases break my query
Дата
Msg-id 3941.959380923@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Re: [SQL] aliases break my query  (Peter Eisentraut <peter_e@gmx.net>)
Список pgsql-hackers
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


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: Re: Re: [SQL] aliases break my query
Следующее
От: "Andy Joseph"
Дата:
Сообщение: where is libpq-fe.h