Re: Replace magic numbers with strategy numbers for B-tree indexes

From: Dilip Kumar <dilipbalaut(at)gmail(dot)com>
To: Daniil Davydov <3danissimo(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Replace magic numbers with strategy numbers for B-tree indexes
Date: 2025-06-30 03:25:45
Message-ID: CAFiTN-tmJMcUAqvCOHRJnT8L3bdGE8MMPohmnQ1rabp4=s0OSA@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Jun 30, 2025 at 8:51 AM Daniil Davydov <3danissimo(at)gmail(dot)com> wrote:
>
> Hi,
> I noticed that some asserts and cycles use magic numbers 1 and 0
> instead of BTLessStrategyNumber and InvalidStrategy.
> At the same time, the BTMaxStrategyNumber macro is used there.
> I suggest using appropriate macros for 1 and 0 values.
>
> Please, see attached patch (targeted on the master branch).

IMHO, it makes sense to use macros when it's already present for
consistency. So +1 or making this change and the attached patch LGTM

--
Regards,
Dilip Kumar
Google

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Masahiko Sawada 2025-06-30 03:41:54 Re: pg_recvlogical cannot create slots with failover=true
Previous Message Zane Duffield 2025-06-30 03:23:10 Re: Check for existing replication slot in pg_createsubscriber