Re: Doing better at HINTing an appropriate column within errorMissingColumn()

Поиск
Список
Период
Сортировка
От Peter Geoghegan
Тема Re: Doing better at HINTing an appropriate column within errorMissingColumn()
Дата
Msg-id CAM3SWZS6kiQEqJz4pV3Fkp6cgw1wS26exOQTjb_XMW3zE5b6mA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Doing better at HINTing an appropriate column within errorMissingColumn()  (Michael Paquier <michael.paquier@gmail.com>)
Список pgsql-hackers
On Tue, Jul 8, 2014 at 6:58 AM, Michael Paquier
<michael.paquier@gmail.com> wrote:
> 6) Sometimes no hints are returned... Even in simple cases like this one:
> =# create table foo (aa int, bb int);
> CREATE TABLE
> =# select ab from foo;
> ERROR:  42703: column "ab" does not exist
> LINE 1: select ab from foo;
>                ^
> LOCATION:  errorMissingColumn, parse_relation.c:3123

In this example, it seems obvious that both "aa" and "bb" should be
suggested when they are not. But what if there were far more columns,
as might be expected in realistic cases (suppose all other columns
have at least 3 characters)? That's another kettle of fish. The
assumption that it's probably one of those two equally distant columns
is now on very shaky ground. After all, the user can only have meant
one particular column. If we apply a limited kind of Turing test to
this second case, how does the most recent revision's algorithm do?
What would a human suggest? I'm pretty sure the answer is that the
human would shrug. Maybe he or she would say "I guess you might have
meant one of either aa or bb, but that really isn't obvious at all".
That doesn't inspire much confidence.

Now, maybe I should be more optimistic about it being one of the two
because there are only two possibilities to begin with. That seems
pretty dubious, though. In general I find it much more plausible based
on what we know that the user should rethink everything. And, as Tom
pointed out, showing nothing conveys something in itself once users
have been trained to expect something.

-- 
Peter Geoghegan



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

Предыдущее
От: Peter Geoghegan
Дата:
Сообщение: Re: Doing better at HINTing an appropriate column within errorMissingColumn()
Следующее
От: Josh Berkus
Дата:
Сообщение: Re: Minmax indexes