PostgreSQL configuration settings
postgresql.conf parameters (GUCs). Read them with SHOW or pg_settings, change them with ALTER SYSTEM or SET, and check pg_settings.context to see whether a reload or a restart applies them.
Inspect what your server runs with
SHOW work_mem; SELECT name, setting, unit, context, source, pending_restart FROM pg_settings WHERE source <> 'default' ORDER BY name;
No setting matched. Try a topic such as memory, log or timeout.
メモリ
Caches, per-query work memory and the ceiling on what the server takes from the OS.
| 設定 | デフォルト | Restart | 何ができるか |
|---|---|---|---|
shared_buffers |
128MB |
はい | Size of PostgreSQL's own page cache, shared by all sessions. |
effective_cache_size |
4GB |
いいえ | The planner's estimate of how much memory is available for caching data, shared buffers plus the OS cache. |
work_mem |
4MB |
いいえ | Memory each sort or hash operation may use before it spills to temporary files. |
hash_mem_multiplier |
2.0 |
いいえ | Multiplier on work_mem for hash joins and hash aggregates. |
maintenance_work_mem |
64MB |
いいえ | Memory for VACUUM, CREATE INDEX, ALTER TABLE ADD FOREIGN KEY and similar maintenance. |
autovacuum_work_mem |
-1 |
いいえ | Memory each autovacuum worker uses to track dead rows; -1 means use maintenance_work_mem. |
temp_buffers |
8MB |
いいえ | Per-session buffer cache for temporary tables. |
huge_pages |
try |
はい | Whether the shared memory segment uses huge pages (Linux and Windows). |
接続
How many sessions the server accepts and what each one costs.
| 設定 | デフォルト | Restart | 何ができるか |
|---|---|---|---|
max_connections |
100 |
はい | Maximum number of concurrent client connections. |
superuser_reserved_connections |
3 |
はい | Connection slots kept back for superusers. |
reserved_connections |
0 |
はい | Connection slots kept back for roles granted pg_use_reserved_connections. |
Parallelism & workers
Worker pools and how many CPUs one query may use.
| 設定 | デフォルト | Restart | 何ができるか |
|---|---|---|---|
max_worker_processes |
8 |
はい | Total background worker processes the server can run. |
max_parallel_workers |
8 |
いいえ | Maximum parallel query workers active at once across the server. |
max_parallel_workers_per_gather |
2 |
いいえ | Workers a single Gather node may start; 0 disables parallel query. |
max_parallel_maintenance_workers |
2 |
いいえ | Parallel workers one CREATE INDEX (B-tree, BRIN, GIN in 18) or VACUUM can use. |
WAL, redo & durability
What a COMMIT waits for and how the change log is sized and written.
| 設定 | デフォルト | Restart | 何ができるか |
|---|---|---|---|
wal_level |
replica |
はい | How much information is written to the WAL. |
synchronous_commit |
on |
いいえ | Whether COMMIT waits for its WAL to reach disk (and standbys) before reporting success. |
wal_buffers |
-1 (auto) |
はい | Shared memory for WAL not yet written to disk; -1 sizes it automatically. |
wal_compression |
off |
いいえ | Compress full-page images written to the WAL. |
full_page_writes |
on |
いいえ | Write a full copy of each page to WAL the first time it changes after a checkpoint. |
max_slot_wal_keep_size |
-1 (unlimited) |
いいえ | Most WAL a replication slot may hold back before it is invalidated; -1 is unlimited. |
Checkpoints & recovery
How often dirty pages are flushed and how long crash recovery may take.
| 設定 | デフォルト | Restart | 何ができるか |
|---|---|---|---|
max_wal_size |
1GB |
いいえ | WAL volume that triggers a checkpoint before checkpoint_timeout is reached. |
min_wal_size |
80MB |
いいえ | WAL kept as recycled segments instead of being removed after a checkpoint. |
checkpoint_timeout |
5min |
いいえ | Longest time between automatic checkpoints. |
checkpoint_completion_target |
0.9 |
いいえ | Fraction of the checkpoint interval over which the checkpoint's writes are spread. |
Disk I/O
Flush rates, I/O threads and how the engine talks to the file system.
| 設定 | デフォルト | Restart | 何ができるか |
|---|---|---|---|
io_method |
worker |
はい | How PostgreSQL issues asynchronous reads: worker processes, io_uring or synchronously. |
effective_io_concurrency |
16 |
いいえ | How many concurrent read requests a session may issue ahead of time. |
Vacuum, statistics & maintenance
Background cleanup and the statistics the planner relies on.
| 設定 | デフォルト | Restart | 何ができるか |
|---|---|---|---|
autovacuum |
on |
いいえ | Whether the autovacuum launcher runs. |
autovacuum_max_workers |
3 |
いいえ | How many autovacuum workers can run at the same time. |
autovacuum_naptime |
1min |
いいえ | Delay between autovacuum runs on any given database. |
autovacuum_vacuum_scale_factor |
0.2 |
いいえ | Fraction of a table that must be dead rows before autovacuum vacuums it. |
autovacuum_analyze_scale_factor |
0.1 |
いいえ | Fraction of a table that must change before autovacuum re-collects its statistics. |
autovacuum_vacuum_cost_limit |
-1 (uses vacuum_cost_limit = 200) |
いいえ | I/O budget autovacuum spends before sleeping for autovacuum_vacuum_cost_delay; -1 uses vacuum_cost_limit. |
autovacuum_freeze_max_age |
200000000 |
はい | Transaction age at which a table gets a forced anti-wraparound vacuum. |
default_statistics_target |
100 |
いいえ | How detailed the statistics ANALYZE collects per column. |
Query planner
Cost model and plan-shape switches.
| 設定 | デフォルト | Restart | 何ができるか |
|---|---|---|---|
random_page_cost |
4.0 |
いいえ | Planner cost of a non-sequential page read, relative to seq_page_cost (1.0). |
jit |
on |
いいえ | Whether queries may be compiled with LLVM JIT. |
Timeouts
Limits on statements, lock waits and idle sessions.
| 設定 | デフォルト | Restart | 何ができるか |
|---|---|---|---|
statement_timeout |
0 (disabled) |
いいえ | Abort any statement that runs longer than this; 0 disables. |
lock_timeout |
0 (disabled) |
いいえ | Abort a statement that waits longer than this to acquire a lock; 0 disables. |
idle_in_transaction_session_timeout |
0 (disabled) |
いいえ | Terminate sessions that sit idle inside an open transaction for longer than this; 0 disables. |
transaction_timeout |
0 (disabled) |
いいえ | Terminate any session whose transaction has run longer than this; 0 disables. |
deadlock_timeout |
1s |
いいえ | How long to wait on a lock before checking for a deadlock. |
Logging & diagnostics
What gets logged and which runtime statistics are collected.
| 設定 | デフォルト | Restart | 何ができるか |
|---|---|---|---|
log_min_duration_statement |
-1 (disabled) |
いいえ | Log every statement that runs at least this long; -1 disables, 0 logs everything. |
log_lock_waits |
off |
いいえ | Log a message when a session waits longer than deadlock_timeout for a lock. |
log_checkpoints |
on |
いいえ | Log each checkpoint with buffers written and timings. |
log_autovacuum_min_duration |
10min |
いいえ | Log autovacuum runs that take at least this long; -1 disables, 0 logs all. |
log_temp_files |
-1 (disabled) |
いいえ | Log temporary files at or above this size when they are deleted; -1 disables, 0 logs all. |
track_io_timing |
off |
いいえ | Collect timing for data file reads and writes. |
Temporary storage
Internal temporary tables, tempdb and spill space.
| 設定 | デフォルト | Restart | 何ができるか |
|---|---|---|---|
temp_file_limit |
-1 (unlimited) |
いいえ | Most temporary-file space one process may use; -1 is unlimited. |
SQL behavior
Settings that change query results or locking semantics, not just speed.
| 設定 | デフォルト | Restart | 何ができるか |
|---|---|---|---|
shared_preload_libraries |
'' (empty) |
はい | Libraries loaded into the server at startup, such as pg_stat_statements or auto_explain. |
max_locks_per_transaction |
64 |
はい | Average number of object locks per transaction used to size the shared lock table. |
Security & access
Network exposure and features that widen the attack surface.
| 設定 | デフォルト | Restart | 何ができるか |
|---|---|---|---|
listen_addresses |
localhost |
はい | Network interfaces the server accepts TCP connections on. |
PostgreSQL configuration FAQ
What do the pg_settings context values mean?
postmaster means a server restart is required; sighup means a reload (SELECT pg_reload_conf()) is enough; superuser and user parameters can also be changed per session with SET, superuser ones only by superusers or roles granted SET on that parameter (PostgreSQL 15 and later).
Where does ALTER SYSTEM write its changes?
To postgresql.auto.conf in the data directory, which is read after postgresql.conf, so it wins. Remove an entry with ALTER SYSTEM RESET name. pg_file_settings shows every file entry and flags the ones with errors.
How do I see which settings need a restart to take effect?
SELECT name, setting FROM pg_settings WHERE pending_restart; lists parameters whose file value has been changed and reloaded but cannot apply until the server restarts.
The full list is in the PostgreSQL manual. Other engines: MySQL, SQL Server, Oracle, SQLite.
Related on SQLly
Run these queries against your own server
SQLly connects to PostgreSQL and the other engines in this reference from one desktop app on macOS, Windows and Linux, with a results grid you can sort, filter and export.