From: Jinqing Kuang <kuangjinqingcn@gmail.com>
To: Priyanka S <developerette@gmail.com>
Cc: pgsql-hackers@lists.postgresql.org
Subject: Re: [Patch] Implement TODOs for index operator strategy number validation
Date: Tue, 8 Sep 2026 16:17:25 +0800
Message-ID: <14FB7D28-9BEE-4FFE-9FB8-A75BF97D4C11@gmail.com> (raw)
In-Reply-To: <CA+Db6gb2-r2+PcuStf3Y7oviS9t7eTxDHisXLer4mtupqkXcqg@mail.gmail.com>
References: <CA+Db6gb2-r2+PcuStf3Y7oviS9t7eTxDHisXLer4mtupqkXcqg@mail.gmail.com>
> On Aug 3, 2026, at 22:35, Priyanka S <developerette@gmail.com> wrote:
>
> Hi,
>
> 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.
>
> I have tested this patch using 'make check' and 'make worldcheck'. All the tests pass.
>
> This is my first contribution, so any input would be appreciated.
>
> 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 = 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-hackers@postgresql.org
Cc: kuangjinqingcn@gmail.com, developerette@gmail.com
Subject: Re: [Patch] Implement TODOs for index operator strategy number validation
In-Reply-To: <14FB7D28-9BEE-4FFE-9FB8-A75BF97D4C11@gmail.com>
References: <CA+Db6gb2-r2+PcuStf3Y7oviS9t7eTxDHisXLer4mtupqkXcqg@mail.gmail.com> <14FB7D28-9BEE-4FFE-9FB8-A75BF97D4C11@gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox