update_setting
Change or reset PostgreSQL settings with ALTER SYSTEM, preview via dry-run, and revert with automatic undo.
Instructions
[WRITE][risk=medium] ALTER SYSTEM SET (or RESET) a parameter. Reversible.
Writes postgresql.auto.conf; most parameters need SELECT pg_reload_conf() (or
a restart for postmaster-context settings) to take effect — reported but NOT
performed automatically. The prior state is captured so the harness records
an undo. Pass dry_run=True to preview.
reset=True issues ALTER SYSTEM RESET, dropping the parameter's auto.conf
entry so postgresql.conf or the built-in default applies again. That is the
recorded inverse when the parameter had no auto.conf entry to begin with:
writing the prior value back would leave a pin that shadows postgresql.conf.
Refuses the connection-affecting postmaster settings (listen_addresses,
port, max_connections, superuser_reserved_connections, ssl, hba_file):
nothing breaks now, but the operator's next restart applies them and strands
the undo. Enforced under dry_run too.
Args:
name: The configuration parameter name (e.g. work_mem).
value: The new value (as a string). Omit when reset=True.
reset: If True, ALTER SYSTEM RESET the parameter instead of setting it.
dry_run: If True, preview without changing.
target: Target name from config; omit for the default.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | ||
| reset | No | ||
| value | No | ||
| target | No | ||
| dry_run | No |