From 1613de8bc34b4977d0186b56ef5a00ef8058a74a Mon Sep 17 00:00:00 2001 From: David Rowley Date: Tue, 8 Nov 2022 10:54:04 +1300 Subject: [PATCH] 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 --- src/backend/parser/gram.y | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index deb101710e..2dddd8f302 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -18428,10 +18428,13 @@ parsePartitionStrategy(char *strategy) return PARTITION_STRATEGY_RANGE; else if (pg_strcasecmp(strategy, "hash") == 0) return PARTITION_STRATEGY_HASH; + ereport(ERROR, (errcode(ERRCODE_INVALID_PARAMETER_VALUE), errmsg("unrecognized partitioning strategy \"%s\"", strategy))); + return PARTITION_STRATEGY_LIST; /* keep compiler quiet */ + } /*