select open change scope Open full search

PG.CENTER connects PostgreSQL documentation, reference, and ecosystem knowledge. Maintained by Pigsty.

CONFIGURATION / PRESET OPTIONS

wal_segment_size

Read PG 18 manual ↗

Reports the size of write ahead log segments.

Type
integer
Context
internal
Measured default
16 MiB
Unit
B
Metadata snapshot
18

Definition PG 18 manual

Reports the size of write ahead log segments. The default value is 16MB. See Section 28.5 for more information.

Measured default history
Version intervalDefault
9.0 – 1016 MiB (2048 × 8kB)
11 – 1916 MiB
Analysis & operational context

Authored guidance from the GUC source snapshot; the version-specific manual above is the definition reference. View source ↗

How it works

Shows the size of write ahead log segments. It is read-only and cannot be changed with SET or configuration-file edits.

It reports the WAL segment size. PostgreSQL 11 and later choose it at initdb time; older clusters normally inherit the build-time value.

Interpret it with min_wal_size, max_wal_size, wal_keep_size. Applications and operations tooling may read wal_segment_size for capability or environment detection, but cannot SET it; cross-cluster comparisons must account for build, initdb, and current-database differences.

Operational considerations

Trying to change read-only wal_segment_size with SET or a configuration file.

Assuming every cluster, database, or vendor build reports the same value.

Ignoring the value in file-format or feature-compatibility checks.

Treating reported metadata as a performance target instead of an environment fact.

Workload guidance

OLAP: Not tunable. Use wal_segment_size to verify format, build, or resource assumptions on analytical nodes and keep every read/write candidate compatible.

OLTP: Not tunable. Record wal_segment_size as a deployment/capability fact; if it is unexpected, fix the binary, initdb, or database-creation process rather than trying SET.

SMALL: Not tunable. Preserve it in inventory and incident reports; do not custom-build or rebuild merely to change it without a demonstrated compatibility need.

Version history 5
  1. PG 16 → 17changed
  2. PG 13 → 14changed
  3. PG 11 → 12changed
  4. PG 10 → 11changed
  5. PG 9.5 → 9.6changed

Related entries

Further reading

Definition snapshot: english-manuals:659e97a9d7c75f300f5c2f6fdb8… · English manual source