postgres.git / summary / log / commit / refs

commit    1613de8bc34b4977d0186b56ef5a00ef8058a74a
Author:   David Rowley <drowley@postgresql.org>
Date:     Mon Nov 07 21:54:04 2022 +0000
First released in: 16.0

    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 deb101710e4..2dddd8f302c 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 */ + } /* [parent: 0e758ae89a20]