Re: Improving "missing FROM-clause entry" message - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Improving "missing FROM-clause entry" message
Date
Msg-id 10603.1135618775@sss.pgh.pa.us
Whole thread Raw
In response to Improving "missing FROM-clause entry" message  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Improving "missing FROM-clause entry" message
List pgsql-hackers
I wrote:
> I'm thinking about whether we can't improve the message for "missing
> FROM-clause entry" to somehow account for situations where the table
> does exist in the query but it's referenced from an improper place,
> as in bug #2130 (filed a couple hours ago, not yet visible in mail list
> archives):
> SELECT ... FROM a, b LEFT JOIN c ON (c.task_id=a.task_id ...

On further investigation, this is arguably a regression in 8.1.
Every PG release back to 7.2 has responded to this query with

NOTICE:  adding missing FROM-clause entry for table "a"
ERROR:  JOIN/ON clause refers to "a", which is not part of JOIN

In 8.1, where add_missing_from defaults to false, you get the first
line as an ERROR and so the much-more-useful specific message doesn't
appear.  I think we need to do something about this.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Improving "missing FROM-clause entry" message
Next
From: Bruce Momjian
Date:
Subject: Online backup vs Continuous backup