| From: | Nathan Bossart <nathandbossart(at)gmail(dot)com> |
|---|---|
| To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
| Cc: | Robert Haas <robertmhaas(at)gmail(dot)com>, Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org> |
| Subject: | Re: postgres_fdw hint messages |
| Date: | 2022-09-02 21:26:09 |
| Message-ID: | 20220902212609.GA1216541@nathanxps13 |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
On Thu, Sep 01, 2022 at 04:31:20PM -0700, Nathan Bossart wrote:
> On Thu, Sep 01, 2022 at 07:08:49PM -0400, Tom Lane wrote:
>> (1) there probably needs to be some threshold of closeness, so we don't
>> offer "foobar" when the user wrote "huh"
>
> Agreed.
>
>> (2) there are several places doing this now, and there will no doubt
>> be more later, so we need to try to abstract the logic so it can be
>> shared.
>
> Will do.
Here is a new patch. Two notes:
* I considered whether to try to unite this new functionality with the
existing stuff in parse_relation.c, but the existing code looked a bit too
specialized.
* I chose a Levenshtein distance of 5 as the threshold of closeness for the
hint messages. This felt lenient, but it should hopefully still filter out
some of the more ridiculous suggestions. However, it's still little more
than a wild guess, so if folks think the threshold needs to be higher or
lower, I'd readily change it.
--
Nathan Bossart
Amazon Web Services: https://aws.amazon.com
| Attachment | Content-Type | Size |
|---|---|---|
| v2-0001-Adjust-assorted-hint-messages-that-list-all-valid.patch | text/x-diff | 16.7 KB |
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Melih Mutlu | 2022-09-02 21:52:54 | Re: Mingw task for Cirrus CI |
| Previous Message | Peter Geoghegan | 2022-09-02 21:13:15 | Backpatching nbtree VACUUM (page deletion) hardening |