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 1x3r1a-006iE2-0H for pgsql-hackers@arkaria.postgresql.org; Tue, 08 Sep 2026 08:17:50 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1x3r1Z-005i0j-0S for pgsql-hackers@arkaria.postgresql.org; Tue, 08 Sep 2026 08:17:49 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1x3r1Y-005i0S-2b for pgsql-hackers@lists.postgresql.org; Tue, 08 Sep 2026 08:17:48 +0000 Received: from mail-qv1-xf2a.google.com ([2607:f8b0:4864:20::f2a]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1x3r1W-00000003Xnf-2LZi for pgsql-hackers@lists.postgresql.org; Tue, 08 Sep 2026 08:17:48 +0000 Received: by mail-qv1-xf2a.google.com with SMTP id 6a1803df08f44-910316a2fc9so56489216d6.2 for ; Tue, 08 Sep 2026 01:17:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1788855464; x=1789460264; darn=lists.postgresql.org; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:content-type:from:to:cc :subject:date:message-id:reply-to:content-type; bh=wGwu+nAxIHyd7RCfcjaxKy1ciyFEmV9pVs4Iqov31T0=; b=f6uklnxPm1xQgS6yBCAgEZMoVkzzgsfFKh4j1pyf8Hfa2JARtA0IG7SVkxTICtPHqC 7TR1jlT3k5beaMmjtRIAiwOsqzJrw/FyIVznjQvbP5edJpC6zqR6EaIK5NUw4Fu9BRCa iHmX0TEpSS4HPWau+MGusD0o7f0Nb7IX/ko2j/jxGwsdFzWsDufOiuNteePV0Mgh2drM LdAa+ujH4nFdYVk6Knisj7+cGrxo8FRbEkhIqTMwTGdWLR7M+vpE0QVI1aSjpuVektO2 IGv+u3z56uJRIlgxBmG+BixO18mi51KSNlpRzW8FjL1+2qWITnnnnvJz2fXRJlZZHjZK WfSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1788855464; x=1789460264; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:content-type:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=wGwu+nAxIHyd7RCfcjaxKy1ciyFEmV9pVs4Iqov31T0=; b=F1QRwFBOBPqyZnaZHWc8w6YBKhdhW7QQISzZbbO8gs3SG4Q7ARUtWMYxsoU3PcnVM8 8hsahpGe78JEWf2qRbkGT4iJLQtCgWkFnAjoDSsrsu7GWBuOfTS9Dep/GwyjHnRopoZi gFqUsIAdjUc+kIBZyn8VbYm+QR0oIFi5/unlHCki8/R9XmnGKjt1Str5o7XYEH6fDEyf 0xgyvQ4f2MPoG8r8pVfSPk+Ru1aBiitQ+Qt9ntf1dAx5FwaOw5/hxgoW8dD4uDUkvcCS OBbobQxqnEDjxqXREKREhzsH2ohrUXCYQVpG/FDjNxRcHH5xWQTpRn1SK+vamf8S+DKe 9uOA== X-Gm-Message-State: AFuF++k57dXeqeCLDJnwlIjq4Gq5fKbUDhiXC82a0nBisH5O+ebBWDFb eIlE+dS7Nr/LAty8avaiByx71LIVRgBE2RkkBpvpE/FjHrK1sXPY092D X-Gm-Gg: AYBFou1ltEukKOweP1pVhEw0+Xa+AjtfUQGYssVcCOjqnJdZ6v2rGJir7p4ltjOcePq e9gfrIVqZsoftbYRVJiMcXuZmG4lxfsOdd+sTFJ7EJTY/2vSgotDdvC5m4Hjz5wALvSXr5qOOAW rF8O24K5MZzs7uyWitbXGyGpuLKVeKWnyuHhiIXo/rQqfhZFx0h4Vlm2hwKTzgDXfhhl42Y+GAB QmFBOL5bwsicCyvdJCgMrT06sXMCgdDwYPLwQREndXH1XX/8O16WBOAs5rTmq3x4U55O76EY0pQ vfAimhKFWuA3rt8PTXsy23PESyjbUZgt8oZ38io6sHhgdhaN/qWG75x28LSGzuZH3YqddwoxHPK iyupwXzE+r+oZVBF05oPaeEpR8WayvSSlCjkMgkGL9+xXlWB7Zr/zcWwwqM2/YeTZExyyjqy4TD uOalEsj7427p9LAhTb6BPMvk7WoN7eGF7GHS90QOIwPUhopkCmdW2af+/Ew1C6kR7f X-Received: by 2002:a05:620a:8388:b0:939:9c21:8ece with SMTP id af79cd13be357-9399c21b43fmr1756294085a.42.1788855464208; Tue, 08 Sep 2026 01:17:44 -0700 (PDT) Received: from smtpclient.apple ([67.103.169.62]) by smtp.gmail.com with ESMTPSA id af79cd13be357-9397f9ee9fbsm1085575785a.1.2026.09.08.01.17.42 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 08 Sep 2026 01:17:44 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3864.700.51.1.1\)) Subject: Re: [Patch] Implement TODOs for index operator strategy number validation From: Jinqing Kuang In-Reply-To: Date: Tue, 8 Sep 2026 16:17:25 +0800 Cc: pgsql-hackers@lists.postgresql.org Content-Transfer-Encoding: quoted-printable Message-Id: <14FB7D28-9BEE-4FFE-9FB8-A75BF97D4C11@gmail.com> References: To: Priyanka S X-Mailer: Apple Mail (2.3864.700.51.1.1) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk > On Aug 3, 2026, at 22:35, Priyanka S wrote: >=20 > Hi, >=20 > This patch implements TODOs in the BRIN, GIN, GIST and SP-GIST index = code. Operator class validation is modified to add strategy number = bounds checking specific to each index type. > 1) For BRIN and SP-GIST, the maximum strategy number from the common = RTStrategy list is used as the upper limit. > 2) For SP-GIST, the number of GIS object types and the strategy = numbers per type are used to calculate the maximum strategy number. > 3) As far as I can understand from the code, GIN may have custom = strategies, so the existing limit of 63 is retained.=20 >=20 > I have tested this patch using 'make check' and 'make worldcheck'. All = the tests pass. >=20 > This is my first contribution, so any input would be appreciated. >=20 > Thanks & regards, > Priyanka > <0001-Fix-TODOs-for-index-opclass-strategy-number-validati.patch> Hi Priyanka, Thanks for the patch. I have a concern about the new strategy-number bounds. GiST, SP-GiST and BRIN all set amstrategies =3D 0, meaning that strategy numbers are opclass-defined (see amapi.h and DefineOpClass()). For example, a custom SP-GiST opclass can use strategy 31 if its support functions understand it, but this patch would make amvalidate() reject it. RTMaxStrategyNumber isn't a general limit for BRIN/SP-GiST, and the Geo* constants are specific to the built-in GiST point = implementation. Regards, Jinqing