SQLSTATE 22023 ERROR Class 22: Data Exception

invalid_parameter_value parameter “…” requires a Boolean value — 22023

PostgreSQL error "parameter "…" requires a Boolean value" (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 boolean configuration parameter was given a value that is not a recognized boolean. PostgreSQL raises SQLSTATE 22023 (invalid_parameter_value).

  • The parameter expects on/off/true/false/1/0/yes/no.
  • Common with a numeric or arbitrary string value.
  • Quoting/format mistakes can trigger it.

What the server log shows

ERROR:  parameter "autovacuum" requires a Boolean value

Why PostgreSQL raises this — what the manual says

Section 19.1.1 Parameter Names and Values:

“Values can be written as on, off, true, false, yes, no, 1, 0 (all case-insensitive) or any unambiguous prefix of one of these.”

Boolean GUCs accept only a fixed set of truth literals. A value outside that set cannot be interpreted as boolean, so PostgreSQL reports 22023.

Common causes

  • Using an unsupported literal (e.g. enabled).
  • A typo in on/off.
  • Passing a number other than 0/1.

How to fix it

  1. Use a valid boolean literal: on/off, true/false, 1/0.
  2. Remove stray quotes/whitespace around the value.
  3. Check the parameter type in pg_settings.vartype.

Related & next steps

Reference: PostgreSQL 18 Section 20.1 “Setting Parameters”.

Was this helpful?