Note that this can currently exposes internal elog() errors to users: postgres=# select pg_normalize_config_value('log_min_messages','abc'); WARNING: invalid value for parameter "log_min_messages": "abc" HINT: Available values: debug5, debug4, debug3, debug2, debug1, info, notice, warning, error, log, fatal, panic. ERROR: could not find enum option 0 for log_min_messages
postgres=# \errverbose ERROR: XX000: could not find enum option 0 for log_min_messages LOCATION: config_enum_lookup_by_value, guc.c:7284