55P02
PostgreSQLERRORNotableObject Not in Prerequisite StateHIGH confidence

cannot change runtime parameter

What this means

SQLSTATE 55P02 is a Postgres-specific error raised when a GUC (Grand Unified Configuration) parameter cannot be changed at runtime because it is a startup-only or superuser-only parameter, or the session does not have the authority to change it.

Why it happens
  1. 1Attempting to SET a parameter marked as PGC_POSTMASTER (requires server restart to change)
  2. 2A non-superuser trying to SET a superuser-only parameter
  3. 3Attempting to change a parameter whose scope does not allow session-level changes
How to reproduce

Setting a startup-only parameter at runtime.

trigger — this will error
trigger — this will error
SET max_connections = 200; -- can only be changed in postgresql.conf + restart

expected output

ERROR:  parameter "max_connections" cannot be changed without restarting the server

Fix 1

Change the parameter in postgresql.conf and restart the server

WHEN When a startup-only parameter needs to be changed.

Change the parameter in postgresql.conf and restart the server
-- In postgresql.conf:
-- max_connections = 200
-- Then: pg_ctl restart

Why this works

Startup-only parameters are read at server start and cannot be changed while the server is running. Edit postgresql.conf and restart Postgres.

Fix 2

Use pg_reload_conf() for SIGHUP-reloadable parameters

WHEN When the parameter can be reloaded without a restart.

Use pg_reload_conf() for SIGHUP-reloadable parameters
-- Edit postgresql.conf, then:
SELECT pg_reload_conf();

Why this works

Some parameters (PGC_SIGHUP) can be reloaded without a full restart. Check the parameter description in the documentation.

Sources
Official documentation ↗

Class 55 — Object Not in Prerequisite State (Postgres-specific)

Content generated with AI assistance and reviewed for accuracy. Found an error? hello@errcodes.dev

← All PostgreSQL errors