// postgresql · logging & diagnostics

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.

// one client for every engine

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.