log_replication_commands
Read PG 18 manual ↗Causes each replication command and walsender process's replication slot acquisition/release to be logged in the server log.
- Type
- bool
- Context
- superuser
- Measured default
- off
- Unit
- —
- Metadata snapshot
- 18
Definition PG 18 manual
Causes each replication command and walsender process's replication slot acquisition/release to be logged in the server log. See Section 54.4 for more information about replication command. The default value is off. Only superusers and users with the appropriate SET privilege can change this setting.
Measured default history
| Version interval | Default |
|---|---|
| 9.5 – 19 | off |
Authored guidance from the GUC source snapshot; the version-specific manual above is the definition reference. View source ↗
How it works
log_replication_commands logs each replication command. It covers replication-protocol commands as well as SQL replication commands and can therefore expose replication topology and slot activity.
log_replication_commands is a SUPERUSER-context setting. Superuser or a role granted the appropriate SET privilege can change it for a session, while ALTER ROLE or ALTER DATABASE can establish a default for future sessions.
It changes emitted diagnostic data rather than query semantics, but volume, sensitive content, log_line_prefix, destinations, collector throughput, and retention determine operational cost and usefulness.
Operational considerations
Changing log_replication_commands in one session and assuming role defaults, database defaults, or other pooled sessions changed with it.
Enabling richer logging without budgeting collector throughput, storage, retention, and downstream query cost.
Writing SQL text, bind values, identities, or host data without a redaction and access-control policy.
Changing log_replication_commands globally without a rollback plan and a client or operational compatibility test.
Workload guidance
OLAP: Analytical jobs can justify richer log_replication_commands telemetry, but account for long statements, large bind values, and bursty completion patterns in the log pipeline.
OLTP: Tune log_replication_commands against an explicit observability question and a measured log-volume budget. Prefer selective thresholds, sampling, or role-level overrides over indiscriminate capture.
SMALL: Keep log_replication_commands useful but bounded: verify disk, collector, retention, and redaction capacity before increasing detail or frequency.
Version history 9
- PG 17 → 18changed
- PG 16 → 17changed
- PG 14 → 15changed
- PG 13 → 14changed
- PG 11 → 12changed
- PG 10 → 11changed
- PG 9.6 → 10changed
- PG 9.5 → 9.6changed
- PG 9.4 → 9.5added
Related entries
Further reading
Definition snapshot: english-manuals:5d49c4d4eda1fb0008633ab4682… · English manual source