SQLSTATE 22023 ERROR Class 22: Data Exception

invalid_parameter_value invalid value for parameter “…”: “…” — 22023

PostgreSQL error "invalid value for parameter "…": "…"" (SQLSTATE 22023): what it means, common causes, and how to fix it.

PG 12, 13, 14, 15, 16, 17, 18 Official docs
Last reviewed May 2025 Grounded in source

Diagnostic Queries

Symptoms

A configuration parameter was given a value outside its allowed set/range. PostgreSQL raises SQLSTATE 22023 (invalid_parameter_value).

  • The value is the wrong type or out of range for the parameter.
  • A DETAIL/HINT often lists acceptable values.
  • Common with enum-style or bounded numeric parameters.

What the server log shows

ERROR:  invalid value for parameter "log_min_messages": "verbose"

Why PostgreSQL raises this — what the manual says

Section 19.1.1 Parameter Names and Values:

“Enumerated-type parameters are written in the same way as string parameters, but are restricted to have one of a limited set of values.”

Each GUC has a defined type and valid domain. A value that doesn’t parse or falls outside the allowed set/range is rejected with 22023.

Common causes

  • An out-of-range numeric value.
  • An enum parameter set to an undefined option.
  • A unit/format the parameter does not accept.

How to fix it

  1. Set a value within the parameter’s allowed range/options.
  2. Check valid values: SELECT enumvals FROM pg_settings WHERE name='log_min_messages';.
  3. Include correct units (e.g. '256MB') for memory parameters.

Related & next steps

Reference: PostgreSQL 18 Section 20.1 “Setting Parameters”.

Was this helpful?