Diagnostic Queries
Symptoms
An attempt to change a configuration parameter at runtime failed because that parameter can only be set at server start. PostgreSQL raises SQLSTATE 55P02 (cant_change_runtime_param).
- The parameter has
postmastercontext (restart-only). - Common with
shared_buffers,max_connections, etc. - SET/ALTER SYSTEM can’t apply it live.
What the server log shows
ERROR: parameter "shared_buffers" cannot be changed without restarting the server
Why PostgreSQL raises this — what the manual says
Section 19.1.2 Parameter Interaction via the Configuration File:
“Some parameters can only be set at server start; any changes to their entries in the configuration file will be ignored until the server is restarted.”
Each GUC has a context defining when it can change. postmaster-context parameters allocate fixed resources at startup, so they cannot be changed live; attempting to set them at runtime yields 55P02.
Common causes
- Setting a restart-only parameter via
SETin a session. - Expecting
ALTER SYSTEM+ reload to apply a postmaster-context setting. - Confusing reloadable parameters with restart-only ones.
How to fix it
- Set it in
postgresql.conf(or viaALTER SYSTEM) and restart the server. - Check the parameter’s context:
SELECT name, context FROM pg_settings WHERE name = 'shared_buffers';. - Plan a maintenance window for restart-only changes.
Related & next steps
Reference: PostgreSQL 18 Section 20.1 “Setting Parameters”.
Thanks — noted. This helps keep the database accurate.