PG
PRO
55P02ERRORTier 2 — Caution✅ HIGH confidence

cannot change runtime parameter

Category: Object Not in Prerequisite StateVersions: All Postgres versions

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
SET max_connections = 200; -- can only be changed in postgresql.conf + restart
ERROR: parameter "max_connections" cannot be changed without restarting the server

Fix 1: Change the parameter in postgresql.conf and restart the server

When a startup-only parameter needs to be changed.

fix
-- 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 the parameter can be reloaded without a restart.

fix
-- 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 docs: https://www.postgresql.org/docs/current/errcodes-appendix.html

📚 Feature docs: https://www.postgresql.org/docs/current/config-setting.html

🔧 Source ref: Class 55 — Object Not in Prerequisite State (Postgres-specific)

Confidence assessment

✅ HIGH confidence

Postgres-specific. Stable across all versions.

See also

📄 Reference pages

GUC Parameterspostgresql.confpg_reload_conf
⚙️ This error reference was generated with AI assistance and reviewed for accuracy. Examples are provided to illustrate common scenarios and may not cover every case. Always test fixes in a development environment before applying to production. Spotted an error? Suggest a correction →