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

Nikita Malakhov <hukutoc@gmail.com>

From: Nikita Malakhov <hukutoc@gmail.com>
To: Daniil Davydov <3danissimo@gmail.com>
Cc: Peter Eisentraut <peter@eisentraut.org>, PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Date: 2025-09-01T08:27:28Z
Lists: pgsql-hackers

Attachments

Hi Daniil!

Please correct if I'm wrong, but it seems Peter had another approach in
mind -
magic numbers in separate macros could be easily replaced with enums and
validation functions, which would make code more readable and less
'magical'.
Please check the POC patch in attach.
I've made this just for BT strategies macros and touched only 2 source files
to make a correct but simple example.

--
Regards,
Nikita Malakhov
Postgres Professional
The Russian Postgres Company
https://postgrespro.ru/