Re: [PATCH] Replace magic constant 3 with NUM_MERGE_MATCH_KINDS

Aleksander Alekseev <aleksander@timescale.com>

From: Aleksander Alekseev <aleksander@timescale.com>
To: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Cc: Dean Rasheed <dean.a.rasheed@gmail.com>, Richard Guo <guofenglinux@gmail.com>
Date: 2024-04-18T12:00:09Z
Lists: pgsql-hackers

Attachments

Hi,

> I guess the argument against inserting an enum element at the end is
> that a switch statement on the enum value might generate a compiler
> warning if it didn't have a default clause.

Fair point. PFA the alternative version of the patch.

-- 
Best regards,
Aleksander Alekseev

Commits

  1. Use macro to define the number of enum values

  2. Use macro NUM_MERGE_MATCH_KINDS instead of '3' in MERGE code.