wal_segment_size
Fact — official short description: “Shows the size of write ahead log segments.”
Identity
Lifecycle
| Fact | Value |
|---|---|
| First observed | PG9.0 (research boundary) |
| Present in | PG9.0–19 Beta 3 |
| Removed in | No |
| Introduction commit | Not asserted: predates the PG9.0 research boundary |
| Commit date | — |
| Discussion | — |
Default history
| Versions | Raw boot_val |
Unit | Human value |
|---|---|---|---|
| PG9.0–10 | 2048 |
8kB |
16 MiB (2048 × 8kB) |
| PG11–19 Beta 3 | 16777216 |
B |
16 MiB |
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.
Tuning advice
Advice. These are workload-specific starting points and must be validated with measurements.
| Workload | Guidance |
|---|---|
| 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. |
| OLAP | Not tunable. Use wal_segment_size to verify format, build, or resource assumptions on analytical nodes and keep every read/write candidate compatible. |
| Small nodes | Not tunable. Preserve it in inventory and incident reports; do not custom-build or rebuild merely to change it without a demonstrated compatibility need. |
Pigsty
Values use the fixed 8-vCPU, 32-GiB, 100-GiB SSD fixture and render the current Pigsty templates for PG19 Beta 3; this does not assert current Pigsty support for that historical or beta release.
| Template | Effective value | Versus upstream boot | Source expression |
|---|---|---|---|
| OLTP | Unmodified | — | — |
| OLAP | Unmodified | — | — |
| CRIT | Unmodified | — | — |
| TINY | Unmodified | — | — |
Advice — pending human review. Fact from the current Pigsty template projection: OLTP: PG9.0–19 Beta 3 unmodified; OLAP: PG9.0–19 Beta 3 unmodified; CRIT: PG9.0–19 Beta 3 unmodified; TINY: PG9.0–19 Beta 3 unmodified. No Pigsty-specific rationale is inferred from an absent override.
Common pitfalls
- 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.
Related parameters
min_wal_size · max_wal_size · wal_keep_size · checkpoint_timeout · checkpoint_completion_target · wal_keep_segments