Re: Doing better at HINTing an appropriate column within errorMissingColumn() - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Doing better at HINTing an appropriate column within errorMissingColumn()
Date
Msg-id 28099.1416359014@sss.pgh.pa.us
Whole thread Raw
In response to Re: Doing better at HINTing an appropriate column within errorMissingColumn()  (Peter Geoghegan <pg@heroku.com>)
Responses Re: Doing better at HINTing an appropriate column within errorMissingColumn()  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
Peter Geoghegan <pg@heroku.com> writes:
> On Tue, Nov 18, 2014 at 3:29 PM, Robert Haas <robertmhaas@gmail.com> wrote:
>> On Mon, Nov 17, 2014 at 3:04 PM, Peter Geoghegan <pg@heroku.com> wrote:
>>> postgres=# select qty from orderlines ;
>>> ERROR:  42703: column "qty" does not exist
>>> HINT:  Perhaps you meant to reference the column "orderlines"."quantity".

>> I don't buy this example, because it would give you the same hint if
>> you told it you wanted to access a column called ant, or uay, or tit.
>> And that's clearly ridiculous.  The reason why quantity looks like a
>> reasonable suggestion for qty is because it's a conventional
>> abbreviation, but an extremely high percentage of comparable cases
>> won't be.

> I maintain that omission of part of the correct spelling should be
> weighed less.

I would say that omission of the first letter should completely disqualify
suggestions based on this heuristic; but it might make sense to weight
omissions less after the first letter.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Peter Geoghegan
Date:
Subject: Re: Doing better at HINTing an appropriate column within errorMissingColumn()
Next
From: Michael Paquier
Date:
Subject: Re: pg_receivexlog --status-interval add fsync feedback