Christophe Pettus: All Your GUCs in a Row: block_size
The article discusses the PostgreSQL parameter 'block_size', which is fixed at 8192 bytes and cannot be changed at runtime. It explains the significance of this parameter in relation to database operations and why it is included in pg_settings. The author advises that changing the block size is generally unnecessary and can lead to compatibility issues.
- ▪The block_size parameter is read-only at runtime and can only be set during PostgreSQL compilation.
- ▪Changing the block size after installation requires starting over with a fresh cluster and can cause compatibility issues with tools and extensions.
- ▪The default block size of 8192 bytes has been maintained throughout PostgreSQL's history, and most users should not attempt to change it.
Planet PostgreSQL files mainly under programming. We currently carry 25 of its stories.
Opening excerpt (first ~120 words) tap to expand
2026-05-17 3 min PostgreSQL All Your GUCs in a Row: block_size A parameter you cannot change. block_size lives in the “Preset Options” section of the docs, alongside its read-only cousins like data_checksums, wal_block_size, and server_version. It reports the size of a PostgreSQL page — the fundamental unit of on-disk storage and buffer-pool accounting. Default is 8192 bytes. It is read-only at runtime, settable only when PostgreSQL is compiled, and changing it after the fact means starting over with a fresh cluster. So why is it in pg_settings at all? Because everything in the database is measured in units of it. What 8KB actually means shared_buffers = 4GB? That’s 524,288 pages of 8KB each. pg_class.relpages for a 100MB table? 12,800.
…
Excerpt limited to ~120 words for fair-use compliance. The full article is at Postgr.