Skip to content

PostgreSQL Configuration Parameters

This page lists the PostgreSQL server parameters a Managed PostgreSQL service accepts, with their type, their accepted values and whether changing them restarts the service.

Note

The tables below were generated from the settings catalog on 2026-11-10. The catalog is the contract the API enforces and can change. Regenerate or check them with:

exo api get-dbaas-settings-pg -z ch-gva-2 -q 'settings.pg.properties'

exo dbaas type show pg --settings pg prints the same keys with their descriptions, but shows the autovacuum, bg-writer and wal groups as a single object row each.

What each parameter does is described in the PostgreSQL documentation ↗. Values use the unit stated in the catalog description, which can differ from the unit pg_settings shows: the catalog takes max_stack_depth in bytes, for example. The value in force on a service is what SHOW PARAMETER_NAME; returns, and it does not always match the default quoted in the catalog description: autovacuum_analyze_scale_factor is described with a default of 0.2 and runs at 0.1.

Set a Parameter

Managed PostgreSQL has no postgresql.conf you can edit and no ALTER SYSTEM, because avnadmin is not a superuser. Set parameters on the service:

exo dbaas update SERVICE_NAME -z ZONE -f --pg-settings='JSON_OBJECT'

Parameters:

  • SERVICE_NAME: name of the Managed PostgreSQL service.
  • ZONE: zone the service runs in, for example ch-gva-2.
  • JSON_OBJECT: a JSON object whose keys are parameter names from the tables below.

For example:

exo dbaas update my-postgresql -z ch-gva-2 -f \
  --pg-settings='{"log_min_duration_statement":500,"track_io_timing":"on"}'

Without -f, the command asks for confirmation and, in a script or any other non-interactive shell, exits with status 1 after printing EOF, without applying anything.

Values must match the declared type: integers unquoted, booleans as true or false, strings quoted. track_io_timing and track_commit_timestamp are strings that take "on" or "off"; a JSON boolean is rejected with Invalid type. Expected: string, given: boolean. jit is a real boolean.

Each update is merged into the stored settings: keys you leave out keep their value. The complete procedure is in Configure PostgreSQL settings.

Important

exo dbaas update --pg-settings leaves out keys whose value is 0. Alone, such a key fails with No data to update the service; inside a group it is skipped without an error. Set a 0 with the API: echo '{"pg-settings":{"KEY":0}}' | exo api update-dbaas-service-pg SERVICE_NAME -z ZONE.

Parameters That Restart the Service

The Restart column marks the parameters whose catalog description ends with Changing this parameter causes a service restart. A restart drops every open connection, including those of connection pools, so apply these changes in a window you control.

From inside the database, pg_settings shows which parameters need a server restart to change (context is postmaster):

SELECT name, setting, context FROM pg_settings WHERE context = 'postmaster' ORDER BY name;

On PostgreSQL 18, autovacuum_max_workers has the context sighup: changing it applies with a configuration reload, even though the catalog marks it as restarting the service.

PostgreSQL Parameters

ParameterTypeAllowed valuesRestart
deadlock_timeoutinteger500 to 1800000
default_toast_compressionstringlz4, pglz
idle_in_transaction_session_timeoutinteger0 to 604800000
io_combine_limitinteger1 to 32
io_max_combine_limitinteger1 to 128yes
io_max_concurrencyinteger-1 to 1024yes
io_methodstringworker, sync, io_uringyes
io_workersinteger1 to 32
jitbooleantrue, false
log_error_verbositystringTERSE, DEFAULT, VERBOSE
log_line_prefixstring'pid=%p,user=%u,db=%d,app=%a,client=%h ', 'pid=%p,user=%u,db=%d,app=%a,client=%h,txid=%x,qid=%Q ', '%t [%p]: [%l-1] user=%u,db=%d,app=%a,client=%h ', '%m [%p] %q[user=%u,db=%d,app=%a] '
log_min_duration_statementinteger-1 to 86400000
log_temp_filesinteger-1 to 2147483647
max_files_per_processinteger1000 to 4096yes
max_locks_per_transactioninteger64 to 6400yes
max_logical_replication_workersinteger4 to 256yes
max_parallel_workersinteger0 to 96
max_parallel_workers_per_gatherinteger0 to 96
max_pred_locks_per_transactioninteger64 to 5120yes
max_prepared_transactionsinteger0 to 10000yes
max_replication_slotsinteger8 to 256yes
max_stack_depthinteger2097152 to 6291456
max_standby_archive_delayinteger1 to 43200000
max_standby_streaming_delayinteger1 to 43200000
max_sync_workers_per_subscriptioninteger2 to 8
max_worker_processesinteger8 to 288yes
password_encryptionstringmd5, scram-sha-256
pg_partman_bgw.intervalinteger3600 to 604800
pg_partman_bgw.rolestringup to 64 characters
pg_stat_monitor.pgsm_enable_query_planbooleantrue, false
pg_stat_monitor.pgsm_max_bucketsinteger1 to 10yes
pg_stat_statements.trackstringall, top, none
temp_file_limitinteger-1 to 2147483647
timezonestringup to 64 characters
track_activity_query_sizeinteger1024 to 10240yes
track_commit_timestampstringoff, onyes
track_functionsstringall, pl, none
track_io_timingstringoff, on

Two more keys appear in the catalog but cannot be set:

  • synchronous_commit: exo dbaas update drops it without a message, and the API answers No data to update the service. It is off on Managed PostgreSQL, where upstream PostgreSQL defaults to on. Its context is user, so avnadmin can change it for a session, a role or a database with SET, ALTER ROLE ... SET or ALTER DATABASE ... SET. See High availability.
  • pg_stat_plans.track: the API answers Settings: ["pg_stat_plans.track"] not valid. CREATE EXTENSION pg_stat_plans succeeds, but querying its view fails with pg_stat_plans must be loaded via "shared_preload_libraries".

The pg_stat_monitor.* parameters are accepted, but the pg_stat_monitor module is not loaded, so they have no effect: querying the view of the extension fails with Must be loaded via shared_preload_libraries.

The io_* parameters are marked EXPERIMENTAL in the catalog. io_combine_limit requires PostgreSQL 17 or later, the four others PostgreSQL 18 or later. The catalog description of io_method repeats the one of io_max_concurrency; io_method selects the asynchronous I/O implementation. Measure the effect of a change on a fork before applying it to a production service.

Grouped Parameters

Three groups, autovacuum, bg-writer and wal, are nested objects inside the pg namespace. Set them as nested JSON:

exo dbaas update my-postgresql -z ch-gva-2 -f \
  --pg-settings='{"autovacuum":{"autovacuum_naptime":30,"autovacuum_vacuum_scale_factor":0.05},"wal":{"wal_sender_timeout":120000}}'

Warning

The group key is bg-writer, with a hyphen, while the parameters inside it are named bgwriter_*. bgwriter as a group key is rejected with Additional property bgwriter is not allowed.

Read the stored groups back with exo api get-dbaas-service-pg my-postgresql -z ch-gva-2 -q '"pg-settings"', then check the value in force with SHOW.

autovacuum

ParameterTypeAllowed valuesRestart
autovacuum_analyze_scale_factornumber0 to 1
autovacuum_analyze_thresholdinteger0 to 2147483647
autovacuum_freeze_max_ageinteger200000000 to 1500000000yes
autovacuum_max_workersinteger1 to 20yes
autovacuum_naptimeinteger1 to 86400
autovacuum_vacuum_cost_delayinteger-1 to 100
autovacuum_vacuum_cost_limitinteger-1 to 10000
autovacuum_vacuum_scale_factornumber0 to 1
autovacuum_vacuum_thresholdinteger0 to 2147483647
log_autovacuum_min_durationinteger-1 to 2147483647

A per-table storage parameter often fits better than a service-wide change, because it targets the one table that needs it:

ALTER TABLE events SET (autovacuum_vacuum_scale_factor = 0.01, autovacuum_vacuum_threshold = 5000);

Raising autovacuum_freeze_max_age postpones the anti-wraparound vacuum. Watch the transaction ID age as described in Monitor a Managed PostgreSQL service.

bg-writer

ParameterTypeAllowed valuesRestart
bgwriter_delayinteger10 to 10000
bgwriter_flush_afterinteger0 to 2048
bgwriter_lru_maxpagesinteger0 to 1073741823
bgwriter_lru_multipliernumber0 to 10

On PostgreSQL 17 and later, the checkpoint counters are in pg_stat_checkpointer rather than in pg_stat_bgwriter.

wal

ParameterTypeAllowed valuesRestart
max_slot_wal_keep_sizeinteger-1 to 2147483647
max_wal_sendersinteger20 to 256yes
wal_sender_timeoutinteger0 to 10800000
wal_writer_delayinteger10 to 200

max_slot_wal_keep_size is -1 on a new service: an inactive replication slot can then retain write-ahead log without limit and fill the disk. Set a bound in megabytes so that such a slot is invalidated instead:

exo dbaas update my-postgresql -z ch-gva-2 -f \
  --pg-settings='{"wal":{"max_slot_wal_keep_size":10240}}'

See Prevent a full disk. The platform’s WAL archiver uses one WAL sender and appears in pg_stat_replication as pghoard.

Related Pages

Last updated on