Re: [PATCH] Replace magic constant 3 with NUM_MERGE_MATCH_KINDS

Peter Eisentraut <peter@eisentraut.org>

From: Peter Eisentraut <peter@eisentraut.org>
To: Aleksander Alekseev <aleksander@timescale.com>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Cc: Richard Guo <guofenglinux@gmail.com>, Dean Rasheed <dean.a.rasheed@gmail.com>
Date: 2024-05-12T11:57:43Z
Lists: pgsql-hackers
On 19.04.24 11:47, Aleksander Alekseev wrote:
> Thanks. I see a few pieces of code that use special FOO_NUMBER enum
> values instead of a macro. Should we refactor these pieces
> accordingly? PFA another patch.

I think this is a sensible improvement.

But please keep the trailing commas on the last enum items.




Commits

  1. Use macro to define the number of enum values

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