select open change scope Open full search

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

CONFIGURATION / PRESET OPTIONS

Reports the number of blocks (pages) that can be stored within a file segment.

Type
integer
Context
internal
Measured default
1 GiB (131072 × 8kB)
Unit
8kB
Metadata snapshot
18

Definition PG 18 manual

Reports the number of blocks (pages) that can be stored within a file segment. It is determined by the value of RELSEG_SIZE when building the server. The maximum size of a segment file in bytes is equal to segment_size multiplied by block_size; by default this is 1GB.

Measured default history
Version intervalDefault
9.0 – 191 GiB (131072 × 8kB)
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 number of pages per disk file. It is read-only and cannot be changed with SET or configuration-file edits.

It reports the number of database pages per relation segment; together with block_size it determines the file-segmentation boundary.

Interpret it with block_size, wal_block_size, wal_segment_size. Applications and operations tooling may read 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 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 segment_size to verify format, build, or resource assumptions on analytical nodes and keep every read/write candidate compatible.

OLTP: Not tunable. Record 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.

Related entries

Further reading

Definition snapshot: english-manuals:95831d6bc336094a6bfdd240cd9… · English manual source