Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oTtIz-0003HA-Kw for pgsql-hackers@arkaria.postgresql.org; Thu, 01 Sep 2022 23:09:01 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oTtIy-0002zV-5v for pgsql-hackers@arkaria.postgresql.org; Thu, 01 Sep 2022 23:09:00 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oTtIx-0002zM-TH for pgsql-hackers@lists.postgresql.org; Thu, 01 Sep 2022 23:08:59 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oTtIr-0004cd-Hf for pgsql-hackers@postgresql.org; Thu, 01 Sep 2022 23:08:59 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 281N8nvL789103; Thu, 1 Sep 2022 19:08:49 -0400 From: Tom Lane To: Nathan Bossart cc: Robert Haas , Peter Eisentraut , pgsql-hackers Subject: Re: postgres_fdw hint messages In-reply-to: <20220901223128.GA932597@nathanxps13> References: <1929340.1661531738@sss.pgh.pa.us> <20220901223128.GA932597@nathanxps13> Comments: In-reply-to Nathan Bossart message dated "Thu, 01 Sep 2022 15:31:28 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <789101.1662073729.1@sss.pgh.pa.us> Date: Thu, 01 Sep 2022 19:08:49 -0400 Message-ID: <789102.1662073729@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Nathan Bossart writes: > On Fri, Aug 26, 2022 at 12:35:38PM -0400, Tom Lane wrote: >> I vote for just dropping all these hints for now, while leaving the >> door open for anyone who wants to write closest-match-offering code. > Here is a quickly-hacked-together proof-of-concept for using Levenshtein > distances to determine which option to include in the hint. Would > something like this suffice? If so, I will work on polishing it up a bit. Seems reasonable to me, but (1) there probably needs to be some threshold of closeness, so we don't offer "foobar" when the user wrote "huh" (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. regards, tom lane