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 1wJljG-000GMG-2g for pgsql-bugs@arkaria.postgresql.org; Mon, 04 May 2026 05:20:27 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wJljF-005jEJ-24 for pgsql-bugs@arkaria.postgresql.org; Mon, 04 May 2026 05:20:25 +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 1wJljF-005jE2-0m for pgsql-bugs@lists.postgresql.org; Mon, 04 May 2026 05:20:25 +0000 Received: from forwardcorp1d.mail.yandex.net ([178.154.239.200]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1wJljA-00000000644-0whb for pgsql-bugs@postgresql.org; Mon, 04 May 2026 05:20:24 +0000 Received: from mail-nwsmtp-smtp-corp-main-56.klg.yp-c.yandex.net (mail-nwsmtp-smtp-corp-main-56.klg.yp-c.yandex.net [IPv6:2a02:6b8:c42:65a0:0:640:e1de:0]) by forwardcorp1d.mail.yandex.net (Yandex) with ESMTPS id 7C3608046B; Mon, 04 May 2026 08:20:16 +0300 (MSK) Received: from smtpclient.apple (unknown [2a02:6bf:8080:44d::1:23]) by mail-nwsmtp-smtp-corp-main-56.klg.yp-c.yandex.net (smtpcorp) with ESMTPSA id FKX2a11NPGk0-gNcdBz4z; Mon, 04 May 2026 08:20:16 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex-team.ru; s=default; t=1777872016; bh=Vo97efddpEPws76aUrbgLM5aDCjz2LIBR+G88elzvXc=; h=Message-Id:To:Date:References:Cc:In-Reply-To:From:Subject; b=xooEKfgKfEnGzEIhX+cPrnKf54a3oaCg8Q1MIvPYma8O78VHjDc7jYMMiCi6KFeX4 QR9qIhnfkAhfXt0QFujuxCkxiMT7iOxNOlwTFURbaUJ9UNJR1iqnCORsMJkhDBoRaQ D3uk4wEf2F8QQpjXx8U43mOnfvrcrTMPa61HGl/w= Authentication-Results: mail-nwsmtp-smtp-corp-main-56.klg.yp-c.yandex.net; dkim=pass header.i=@yandex-team.ru Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3864.500.181\)) Subject: Re: [BUG] false positive in bt_index_check in case of short 4B varlena datum From: Andrey Borodin In-Reply-To: Date: Mon, 4 May 2026 10:20:04 +0500 Cc: Andres Freund , Alexander Lakhin , Michael Zhilin , pgsql-bugs@postgresql.org, Yura Sokolov Content-Transfer-Encoding: 7bit Message-Id: <13F0EC76-00B9-41D7-8EC3-D1F07FF7C66B@yandex-team.ru> References: <0b535249-a00c-a38a-85f6-d5a38c62dd55@gmail.com> <7ckc7oka4bvafkf5bwlqs6ygrhlsbhz25ppozfch7zbuxcx3rf@e4pr4oqenalc> <71E42FAF-FF92-4EE5-94A5-341EFB891281@yandex-team.ru> To: Alexander Korotkov X-Mailer: Apple Mail (2.3864.500.181) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk > On 4 May 2026, at 00:44, Alexander Korotkov wrote: > > AFAICS, this is correct. However, I propose an alternative approach: > use VARSIZE_ANY(). This might be a bit slower, but looks more > intuitive to me. Works for me. However, I'd like to note that (VARSIZE_1B() < TOAST_INDEX_TARGET) is constantly true for 8Kb+ pages. Best regards, Andrey Borodin.