On Wed, 14 Jan 2026 at 16:40, Álvaro Herrera <alvherre@kurilemu.de> wrote:
> On 2026-Jan-14, Japin Li wrote:
>
>> -#define IS_INDEX(r) ((r)->rd_rel->relkind == RELKIND_INDEX)
>> -#define IS_BTREE(r) ((r)->rd_rel->relam == BTREE_AM_OID)
>> +#define IS_BTREE(r) (IS_INDEX(r) && (r)->rd_rel->relam == BTREE_AM_OID)
>
> I find this coding rather pointless. You can more easily do something
> like
>
> #define IS_BTREE(r) ((r)->rd_rel->relkind == RELKIND_INDEX && (r)->rd_rel->relam == BTREE_AM_OID)
>
> and get rid of the IS_INDEX macro completely, if it's not used anywhere
> else. Same for all the other index AMs.
>
Thanks for the review.
I've fixed it according to your suggestion.
> --
> Álvaro Herrera 48°01'N 7°57'E — https://www.EnterpriseDB.com/
--
Regards,
Japin Li
ChengDu WenWu Information Technology Co., Ltd.