log_checkpoints
Log each checkpoint with buffers written and timings.
- По умолчанию
on- Range
- on, off
- Restart needed
- Нет
- Default checked on
- PostgreSQL 18
Что оно делает
Shows whether checkpoints are triggered by time or by WAL volume (max_wal_size) and how long writing and syncing take.
Значение по умолчанию
on. on since PostgreSQL 15 (off before). Same in 18.
Check the current value
SHOW log_checkpoints; SELECT setting, unit, boot_val, context, source, pending_restart FROM pg_settings WHERE name = 'log_checkpoints';
Change it
ALTER SYSTEM SET log_checkpoints = on; SELECT pg_reload_conf();
No restart: reload with SELECT pg_reload_conf() or pg_ctl reload. It cannot be changed per session (context is sighup).
When to change it
Leave on. On older versions turn it on.
What can go wrong
None worth noting: one line per checkpoint.
Questions about log_checkpoints
What is the default value of log_checkpoints in PostgreSQL?
on. on since PostgreSQL 15 (off before). Same in 18.
Does changing log_checkpoints require a restart?
No. No restart: reload with SELECT pg_reload_conf() or pg_ctl reload. It cannot be changed per session (context is sighup).
When should I change log_checkpoints?
Leave on. On older versions turn it on.
Back to all PostgreSQL settings, or check the PostgreSQL manual for every option.
Check log_checkpoints on your own server
SQLly runs the query above against PostgreSQL and the other engines in this reference, from one desktop app on macOS, Windows and Linux.