Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wfjgN-005d7B-3C for pgsql-bugs@arkaria.postgresql.org; Fri, 03 Jul 2026 19:36:15 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wfjgL-008tjf-2l for pgsql-bugs@arkaria.postgresql.org; Fri, 03 Jul 2026 19:36:13 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wfjgL-008tjW-1x for pgsql-bugs@lists.postgresql.org; Fri, 03 Jul 2026 19:36:13 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1wfjgJ-00000001M9d-48dV for pgsql-bugs@postgresql.org; Fri, 03 Jul 2026 19:36:12 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.18.1/8.18.1) with ESMTP id 663Ja9FK4139381; Fri, 3 Jul 2026 15:36:09 -0400 From: Tom Lane To: Ayush Tiwari cc: =?UTF-8?B?546L6LeD5p6X?= , pgsql-bugs , 3764353996 <3764353996@qq.com> Subject: Re: Fw:Re: Fw: gbt_var_consistent in contrib/btree_gist/btree_utils_var.c has internal-node type confusion on the <> strategy, bypassing exclusion constraints In-reply-to: References: <3748108.1783003096@sss.pgh.pa.us> <3756776.1783011257@sss.pgh.pa.us> <3793780.1783033337@sss.pgh.pa.us> <3854290.1783086630@sss.pgh.pa.us> Comments: In-reply-to Ayush Tiwari message dated "Fri, 03 Jul 2026 22:18:13 +0530" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <4139379.1783107369.1@sss.pgh.pa.us> Date: Fri, 03 Jul 2026 15:36:09 -0400 Message-ID: <4139380.1783107369@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Ayush Tiwari writes: > On Fri, 3 Jul 2026 at 19:20, Tom Lane wrote: >> BTW, thinking some more about 0004: isn't it pointless to check >> gbt_var_node_pf_match in the gbt_var_consistent cases that >> only constrain the lower bound, that is LessEqual and Less? > Hmm, looks like the || gbt_var_node_pf_match(...) clause isn't > needed in the BTLessStrategyNumber and BTLessEqualStrategyNumber > cases. Those only compare against the lower bound, and if query > sorts before lower then it sorts before upper too, so a prefix > match against the (truncated) upper can never succeed there. > I tried changing it locally and ran the regression tests, all passed. I did some more work on that idea (just cosmetic changes) and pushed everything. Thanks for working on this! regards, tom lane