From: Robert Haas Date: Fri, 27 Jun 2025 14:50:02 +0000 (-0400) Subject: add constants for enum length X-Git-Url: http://git.postgresql.org/gitweb/static/gitweb.js?a=commitdiff_plain;h=479d11d986aafbd8b9410ffdc4e23d9ac0c4cd19;p=users%2Frhaas%2Fpostgres.git add constants for enum length --- diff --git a/contrib/pg_plan_advice/pgpa_join.h b/contrib/pg_plan_advice/pgpa_join.h index 34992afc81..ee56e24a1c 100644 --- a/contrib/pg_plan_advice/pgpa_join.h +++ b/contrib/pg_plan_advice/pgpa_join.h @@ -37,11 +37,14 @@ typedef struct pgpa_unrolled_join pgpa_unrolled_join; */ typedef enum { - JSTRAT_CLUMP_DEGENERATE, + JSTRAT_CLUMP_DEGENERATE = 0, JSTRAT_CLUMP_FOREIGN, JSTRAT_CLUMP_PARTITIONWISE + /* update NUM_PGPA_CLUMP_JOIN_STRATEGY if you add anything here */ } pgpa_join_clump_strategy; +#define NUM_PGPA_CLUMP_JOIN_STRATEGY ((int) JSTRAT_CLUMP_PARTITIONWISE) + /* * All of the details we need regarding a clumped join. */ @@ -62,14 +65,17 @@ typedef struct */ typedef enum { - JSTRAT_MERGE_JOIN_PLAIN, + JSTRAT_MERGE_JOIN_PLAIN = 0, JSTRAT_MERGE_JOIN_MATERIALIZE, JSTRAT_NESTED_LOOP_PLAIN, JSTRAT_NESTED_LOOP_MATERIALIZE, JSTRAT_NESTED_LOOP_MEMOIZE, JSTRAT_HASH_JOIN + /* update NUM_PGPA_JOIN_STRATEGY if you add anything here */ } pgpa_join_strategy; +#define NUM_PGPA_JOIN_STRATEGY ((int) JSTRAT_HASH_JOIN) + /* * Within a pgpa_unrolled_join, we may need to refer to either to scans or to * other joins, which may be either unrolled or clumped.