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

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Peter Geoghegan <pg(at)heroku(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Heikki Linnakangas <hlinnakangas(at)vmware(dot)com>, Michael Paquier <michael(dot)paquier(at)gmail(dot)com>, Abhijit Menon-Sen <ams(at)2ndquadrant(dot)com>, PostgreSQL mailing lists <pgsql-hackers(at)postgresql(dot)org>, Josh Berkus <josh(at)agliodbs(dot)com>, Ian Barwick <ian(at)2ndquadrant(dot)com>, Andres Freund <andres(at)2ndquadrant(dot)com>, Greg Stark <stark(at)mit(dot)edu>, Jim Nasby <jim(at)nasby(dot)net>, Albe Laurenz <laurenz(dot)albe(at)wien(dot)gv(dot)at>
Subject: Re: Doing better at HINTing an appropriate column within errorMissingColumn()
Date: 2014-12-05 20:33:01
Message-ID: CA+TgmoboUjezUqxK=sbCNvWx2CCqBmh1Qb2HvnjMqLV-=cRQ1w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Dec 3, 2014 at 9:21 PM, Peter Geoghegan <pg(at)heroku(dot)com> wrote:
> On Tue, Dec 2, 2014 at 1:11 PM, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
>> Basically, the case in which I think it's helpful to issue a
>> suggestion here is when the user has used the table name rather than
>> the alias name. I wonder if it's worth checking for that case
>> specifically, in lieu of what you've done here, and issuing a totally
>> different hint in that case ("HINT: You must refer to this as column
>> as "prime_minister.id" rather than "cameron.id").
>
> Well, if an alias is used, and you refer to an attribute using a
> non-alias name (i.e. the original table name), then you'll already get
> an error suggesting that the alias be used instead -- of course,
> that's nothing new. It doesn't matter to the existing hinting
> mechanism if the attribute name is otherwise wrong. Once you fix the
> code to use the alias suggested, you'll then get this new
> Levenshtein-based hint.

In that case, I think I favor giving no hint at all when the RTE name
is specified but doesn't match exactly.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Geoghegan 2014-12-05 20:45:33 Re: Doing better at HINTing an appropriate column within errorMissingColumn()
Previous Message Robert Haas 2014-12-05 20:09:40 Re: On partitioning