Replace magic numbers with strategy numbers for B-tree indexes

From: Daniil Davydov <3danissimo(at)gmail(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Replace magic numbers with strategy numbers for B-tree indexes
Date: 2025-06-30 03:21:07
Message-ID: CAJDiXghfP5CAVNcCb=LjYMtMDJ1h3kKP8WrpZT_5dGn+7RZWpw@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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).

--
Best regards,
Daniil Davydov

Attachment Content-Type Size
v1-0001-Get-rid-of-magic-numbers.patch text/x-patch 4.2 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Zane Duffield 2025-06-30 03:23:10 Re: Check for existing replication slot in pg_createsubscriber
Previous Message Amit Kapila 2025-06-30 03:15:29 Re: Check for existing replication slot in pg_createsubscriber