From: Nathan Bossart <nathandbossart@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: Peter Eisentraut <peter.eisentraut@enterprisedb.com>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Subject: Re: postgres_fdw hint messages
Date: Thu, 1 Sep 2022 16:31:20 -0700
Message-ID: <20220901233120.GA934376@nathanxps13> (raw)
In-Reply-To: <789102.1662073729@sss.pgh.pa.us>
References: <b1f9f399-3a1a-b554-283f-4ae7f34608e2@enterprisedb.com>
<CA+TgmoY+BuSZm-Fbxx5zC6SuML=2F9YvaYuzVAJ=XyE65BnchQ@mail.gmail.com>
<1929340.1661531738@sss.pgh.pa.us>
<20220901223128.GA932597@nathanxps13>
<789102.1662073729@sss.pgh.pa.us>
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.
I'm also considering checking whether the user-provided string is longer
than MAX_LEVENSHTEIN_STRLEN so that we can avoid the ERROR from
varstr_levenshtein(). Or perhaps varstr_levenshtein() could indicate that
the string is too long without ERROR-ing (e.g., by returning -1). If the
user-provided string is too long, we'd just omit the hint.
--
Nathan Bossart
Amazon Web Services: https://aws.amazon.com
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: nathandbossart@gmail.com, tgl@sss.pgh.pa.us, robertmhaas@gmail.com, peter.eisentraut@enterprisedb.com
Subject: Re: postgres_fdw hint messages
In-Reply-To: <20220901233120.GA934376@nathanxps13>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox