cannot change runtime parameter
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.
- 1Attempting to SET a parameter marked as PGC_POSTMASTER (requires server restart to change)
- 2A non-superuser trying to SET a superuser-only parameter
- 3Attempting to change a parameter whose scope does not allow session-level changes
Setting a startup-only parameter at runtime.
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.
-- 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.
-- 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.
Class 55 — Object Not in Prerequisite State (Postgres-specific)
Content generated with AI assistance and reviewed for accuracy. Found an error? hello@errcodes.dev