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 1oXzTe-0001ba-MO for pgsql-hackers@arkaria.postgresql.org; Tue, 13 Sep 2022 06:32:58 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oXzTc-00084W-RM for pgsql-hackers@arkaria.postgresql.org; Tue, 13 Sep 2022 06:32:56 +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 1oXzTc-00084N-HR for pgsql-hackers@lists.postgresql.org; Tue, 13 Sep 2022 06:32:56 +0000 Received: from out5-smtp.messagingengine.com ([66.111.4.29]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oXzTY-00009z-HI for pgsql-hackers@postgresql.org; Tue, 13 Sep 2022 06:32:55 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id C72D55C0097; Tue, 13 Sep 2022 02:32:47 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Tue, 13 Sep 2022 02:32:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1663050767; x= 1663137167; bh=OwW57OZQzhilyMDsFa7xuOprLQuMB1dgNsl+X1zPHTs=; b=I UUA8iTlkqyZUphpKjI9PukbdmLjXHjiGLQWr0XT/xaaKZLBO73F4yB0+8TQSpjec antUofnVXyhO3p8o3MsDWvIRs49DwsPDTR35bm/IEznraqV8oan8IR2EBECxzDa0 B29UemG9ludE+bExnqAHSrbX5f6UzXHGXNo8Q6G84/VQGLtteCSETFLB6ZlWI6Vr gyrR3ftR8dqs3egGPxeKfLvCw6ptoHTbt83aOTqk4CrLIUjuGL6UPoR1wwUWn/yq UbW2PyvIjlwMCZWSmInqE0ocI5EypCYoXfF0Pg7+JDoRgbHfUBPHYeQOnV4j8pJr gXuNFIOkh/S7cFvbJVnfA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrfedufedgudduudcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefkffggfgfuvfevfhfhjggtgfesthejredttdefjeenucfhrhhomheprfgv thgvrhcugfhishgvnhhtrhgruhhtuceophgvthgvrhdrvghishgvnhhtrhgruhhtsegvnh htvghrphhrihhsvggusgdrtghomheqnecuggftrfgrthhtvghrnhepheelffeggedujeet iefhleetuddvieffhfffvdejvdffgeejkeduleduheduieefnecuvehluhhsthgvrhfuih iivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepphgvthgvrhdrvghishgvnhhtrhgr uhhtsegvnhhtvghrphhrihhsvggusgdrtghomh X-ME-Proxy: Feedback-ID: i131946ab:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 13 Sep 2022 02:32:46 -0400 (EDT) Message-ID: <0fc339d4-3388-3849-4507-ef0fe0c783fa@enterprisedb.com> Date: Tue, 13 Sep 2022 08:32:43 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.2.2 Subject: Re: postgres_fdw hint messages To: Nathan Bossart , Tom Lane Cc: Michael Paquier , Robert Haas , pgsql-hackers References: <1929340.1661531738@sss.pgh.pa.us> <20220901223128.GA932597@nathanxps13> <789102.1662073729@sss.pgh.pa.us> <20220901233120.GA934376@nathanxps13> <20220902212609.GA1216541@nathanxps13> <1267654.1662170814@sss.pgh.pa.us> <20220903043058.GA1264318@nathanxps13> Content-Language: en-US From: Peter Eisentraut In-Reply-To: <20220903043058.GA1264318@nathanxps13> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 03.09.22 06:30, Nathan Bossart wrote: > On Fri, Sep 02, 2022 at 10:06:54PM -0400, Tom Lane wrote: >> I think the distance limit of 5 is too loose though. I see that >> it accommodates examples like "passfile" for "password", which >> seems great at first glance; but it also allows fundamentally >> silly suggestions like "user" for "server" or "host" for "foo". >> We'd need something smarter than Levenshtein if we want to offer >> "passfile" for "password" without looking stupid on a whole lot >> of other cases --- those words seem close, but they are close >> semantically not textually. > > Yeah, it's really only useful for simple misspellings, but IMO even that is > rather handy. > > I noticed that the parse_relation.c stuff excludes matches where more than > half the characters are different, so I added that here and lowered the > distance limit to 4. This seems to prevent the silly suggestions (e.g., > "host" for "foo") while retaining the more believable ones (e.g., > "passfile" for "password"), at least for the small set of examples covered > in the tests. I think this code is compact enough and the hints it produces are reasonable, so I think we could go with it. I notice that for column misspellings, the hint is phrased "Perhaps you meant X." whereas here we have "Did you mean X?". Let's make that uniform.