Fix compiler warning on MSVC

MSVC does not understand that ereport(ERROR) does not return, so just
return the first enum PartitionStrategy value to keep the compiler from
complaining about the missing return.

Discussion: https://postgr.es/m/20221104161934.GB16921@telsasoft.com
pull/138/head^2
David Rowley 3 years ago
parent 0e758ae89a
commit 1613de8bc3
  1. 3
      src/backend/parser/gram.y

@ -18428,10 +18428,13 @@ parsePartitionStrategy(char *strategy)
return PARTITION_STRATEGY_RANGE; return PARTITION_STRATEGY_RANGE;
else if (pg_strcasecmp(strategy, "hash") == 0) else if (pg_strcasecmp(strategy, "hash") == 0)
return PARTITION_STRATEGY_HASH; return PARTITION_STRATEGY_HASH;
ereport(ERROR, ereport(ERROR,
(errcode(ERRCODE_INVALID_PARAMETER_VALUE), (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
errmsg("unrecognized partitioning strategy \"%s\"", errmsg("unrecognized partitioning strategy \"%s\"",
strategy))); strategy)));
return PARTITION_STRATEGY_LIST; /* keep compiler quiet */
} }
/* /*

Loading…
Cancel
Save