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 1oTtem-00052c-Ge for pgsql-hackers@arkaria.postgresql.org; Thu, 01 Sep 2022 23:31:32 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oTtek-0000EL-DR for pgsql-hackers@arkaria.postgresql.org; Thu, 01 Sep 2022 23:31:30 +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 1oTtek-0000EC-3v for pgsql-hackers@lists.postgresql.org; Thu, 01 Sep 2022 23:31:30 +0000 Received: from mail-pl1-x630.google.com ([2607:f8b0:4864:20::630]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1oTteh-0004oo-NG for pgsql-hackers@postgresql.org; Thu, 01 Sep 2022 23:31:29 +0000 Received: by mail-pl1-x630.google.com with SMTP id m2so275276pls.4 for ; Thu, 01 Sep 2022 16:31:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date; bh=6JsfODXH5iVxnJgDG3xJn6EKrejAsO8r56S65hN1SvU=; b=RONLbIEMYe/DvBOM4S/Q2thteb+RJX8YRvPeOM+iB5Yhgz8yIHXso3LB41SZHo4vNc 3i+9kwg+LJBpTUjcZ35WO1t9dcVQC5IUHSw7KaMh54Zo6hBcqKLjW6hN67zSIbAyIrcg iq8ybczPPpiDsnkYyWHegh2ur+uYEfmYydipcO6OpBib1j/CDHGGUdtrwd91XrV/mTrz a1iQ+VOIgXXKMBEnATnfAmpxqZKH9Jz/fgs1hRt+eplWSpwdRAtIflXcCk1j0xnayzBM qJn4+Ti3cENwO7YMy48GN4EJFcfrxA7rmCaJcJwxMhxFoEeNfeBofXnRyyNId/B3zBWE XlAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date; bh=6JsfODXH5iVxnJgDG3xJn6EKrejAsO8r56S65hN1SvU=; b=pE1nqcTfEs78qsbRjVCz6cp3hkYgN0jf6uDiYVT91eWwyUE7tg+ocwsebviNirqJQg 5nq17ZkqRQGJT7Fj+hcnbaC6/31hznRJOL7o0ccRhT22BA/jrzyjr22mqGTtXJlP7hC6 YBFTgcKmBupHcKcqkuz4hD9M+FYGpFIeFHB3CI4BJjVbS7vjFGm/zvuONCwgoTUSSajq C2B1zbNJ2CHbJI8Gr2DDo/amPIdszdNuv5OreM5OYT2tCNkQA+ReWJ6bcTb2fkMaDY3g jc0tE2P5m48SG0141VteujouxhSNkdjCbZ1cVM2YBBKta5UjVn/Ib5zglsLus7THr0Rb I5zA== X-Gm-Message-State: ACgBeo0n9bRz7u3t3pZ9Lr+qziEkYaKkTLjbKU7Ss3IPujdPgb1k07/K B7Xzdb7dt6bH6Wsly6cjFak= X-Google-Smtp-Source: AA6agR7xRzIXzio4ywVYBsiQ45GG7WYzKpsug8P8BvFayO4lLx14VRYjOcit4dHbseXhbXA0ZtpHpw== X-Received: by 2002:a17:90a:bb94:b0:1fd:84c1:bd76 with SMTP id v20-20020a17090abb9400b001fd84c1bd76mr1674668pjr.88.1662075085243; Thu, 01 Sep 2022 16:31:25 -0700 (PDT) Received: from nathanxps13 ([50.47.162.83]) by smtp.gmail.com with ESMTPSA id d134-20020a621d8c000000b00537dde5ff7csm157609pfd.176.2022.09.01.16.31.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Sep 2022 16:31:24 -0700 (PDT) Date: Thu, 1 Sep 2022 16:31:20 -0700 From: Nathan Bossart To: Tom Lane Cc: Robert Haas , Peter Eisentraut , pgsql-hackers Subject: Re: postgres_fdw hint messages Message-ID: <20220901233120.GA934376@nathanxps13> References: <1929340.1661531738@sss.pgh.pa.us> <20220901223128.GA932597@nathanxps13> <789102.1662073729@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <789102.1662073729@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk 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