SQLSTATE 55P02 ERROR Class 55: Object Not In Prerequisite State

cant_change_runtime_param Cant Change Runtime Param — SQLSTATE 55P02

SQLSTATE 55P02 (cant_change_runtime_param): The object is not in a state that permits the operation.

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

Symptoms

The server reports SQLSTATE 55P02 (cant_change_runtime_param), a condition in the Object Not In Prerequisite State class.

  • The error is written to the server log and returned to the client carrying SQLSTATE 55P02.
  • Any driver (libpq, JDBC, psycopg, npgsql, pgx) surfaces this code in its error object so you can branch on it programmatically.
  • PL/pgSQL can trap it by name: EXCEPTION WHEN cant_change_runtime_param THEN.

Environment

Severity: ERROR  |  PostgreSQL versions: 12, 13, 14, 15, 16, 17

Reproduce with the exact statement and read the full message in the server log (raise log_min_messages / set log_min_error_statement for more context).

Root Cause

55P02 belongs to Class 55 — Object Not In Prerequisite State. In this class, the object is not in a state that permits the operation.

The first two characters (55) identify the error class, so application code can match the whole class via 55000 when the specific code is not needed.

Diagnostic Queries

Recovery

Resolve the blocking state first: terminate or wait out sessions holding the object, set a short lock_timeout and retry, or put the object into the required state.

Reference: PostgreSQL error codes — Class 55 (Object Not In Prerequisite State).

Was this helpful?