{"Entry":{"collection":"guc","key":"segment_size","name":"segment_size","aliases":[],"metadata":{"baseline":false,"boot_human":"Not specified","boot_val":null,"category":"Preset Options","category_zh":"","changed_in":[],"changes":[{"documentation_changed":false,"fields":{},"from":"8.3","status":"added","to":"8.4"}],"content_hash":"b1fddbabd52caecdcab1890c181570000aa10155e1fd366df10beb88b4fb8571","context":"","default_changed_in":[],"default_history":[{"from":"9.0","to":"19","value":"1 GiB (131072 × 8kB)"}],"derived_content_hash":"80c4a2bfc880d183e8cc69e94e6753dcc988e7ea57e688160d84559f96fdc635","editorial":{"advice":{"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."},"mechanism":["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."],"pitfalls":["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."],"references":[{"title":"PostgreSQL 19 Beta 4: segment_size","url":"https://www.postgresql.org/docs/19/runtime-config-preset.html#GUC-SEGMENT-SIZE"},{"title":"PostgreSQL 19 release notes","url":"https://www.postgresql.org/docs/19/release-19.html"}],"related":["block_size","wal_block_size","wal_segment_size","data_checksums","server_version_num","data_directory_mode"],"summary":"segment_size — Shows the number of pages per disk file. Observed in PG9.0–19 Beta 4; its last measured boot default is 1 GiB (131072 × 8kB) in PG19 Beta 4, with internal context. This is a beta-snapshot fact and can change before PostgreSQL 19 GA."},"enumvals":[],"first_version":"8.4","group":"Preset Options","group_slug":"preset","imported_at":"2026-09-27T17:57:31.93241+08:00","intro_commit":{},"key":"segment_size","last_version":"20","max_val":"","min_val":"","name":"segment_size","position":347,"present_in":["8.4","9.0","9.1","9.2","9.3","9.4","9.5","9.6","10","11","12","13","14","15","16","17","18","19","20"],"repair_provenance":{"original_source_revision":"english-manuals:39f0ba5e5380e9d7c152f15b7a91f016dba0e4dd7fdb1f991fc3a13f46043df3","receipt_sha256":"f84d5836153db6aecfd762a0cfbbfba775438042680da9d4f58eb9797be356cd","repair":"wiki-repair-20261023"},"short_desc":"Reports the number of blocks (pages) that can be stored within a file segment.","short_desc_zh":"","source_rev":"wiki-repair-20261023:e6219a6d1684db4a9b117e5b0626b7e81f36005343bc4e10c310040b938295bb","unit":"","vartype":"integer"}},"Definition":{"Collection":"guc","Key":"segment_size","SourceDatabase":"center","Version":"18","SourceTable":"guc","SourceKey":"segment_size","SourceRevision":"wiki-repair-20261023:e6219a6d1684db4a9b117e5b0626b7e81f36005343bc4e10c310040b938295bb","Facts":{"boot_val":"131072","category":"Preset Options","context":"internal","description":"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.","description_zh":"报告一个文件段中可以存储的块（页）的数量。由编译服务器时的 RELSEG_SIZE 值决定。一个段文件的最大尺寸（以字节计）等于 segment_size 乘以 block_size，默认是 1GB。","description_zh_html":"\u003cp\u003e\n        报告一个文件段中可以存储的块（页）的数量。由编译服务器时的 \u003ccode class=\"literal\"\u003eRELSEG_SIZE\u003c/code\u003e 值决定。一个段文件的最大尺寸（以字节计）等于 \u003ccode class=\"varname\"\u003esegment_size\u003c/code\u003e 乘以 \u003ccode class=\"varname\"\u003eblock_size\u003c/code\u003e，默认是 1GB。\n       \u003c/p\u003e","doc":{"anchor":"GUC-SEGMENT-SIZE","file":"runtime-config-preset.html","lang":"en","sha256":"4dbfec727b9cee838adefb8a766217748d91ab90190b452a58cec737459582ce","slug":"18"},"documented":true,"enumvals":null,"extra_desc":null,"lang":"en","max_val":"131072","metadata_version":"18","min_val":"131072","name":"segment_size","short_desc":"Shows the number of pages per disk file.","source":"pg-settings-source-snapshot","translation_provenance":{"inputs":[{"kind":"current-pgdoc-translation","path":"/Users/vonng/pgsty/pgdoc/zh/18/html/runtime-config-preset.html","sha256":"d0e95b9a81d5fdf853df26eba7dc096d96b9b45dadda13e0d0353aa72ac7a7b9"}],"kind":"same-version-pgdoc","locale":"zh-Hans","source_revision":"b1b500221dbe5437cfca004d6b04d3f6e422765d","version":"18"},"unit":"8kB","vartype":"integer","zh_from":"same-version-pgdoc"},"ManualEvidence":{"doc":{"anchor":"GUC-SEGMENT-SIZE","file":"runtime-config-preset.html","lang":"en","sha256":"4dbfec727b9cee838adefb8a766217748d91ab90190b452a58cec737459582ce","slug":"18"}},"MeasuredEvidence":{"metadata_version":"18"}},"Text":{"Collection":"guc","Key":"segment_size","SourceDatabase":"center","Version":"18","Locale":"en","Title":"segment_size","Summary":"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.","BodyHTML":"\u003cp\u003eReports 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.\u003c/p\u003e","SourceRevision":"wiki-repair-20261023:e6219a6d1684db4a9b117e5b0626b7e81f36005343bc4e10c310040b938295bb","ContentHash":"506256cc44c83a0e35cd6ab7bb103ecff05403bcae805eec4b99d0ea164242b5","Payload":{"description":"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."}},"RequestedLocale":"en","Fallback":false,"Versions":["10","11","12","13","14","15","16","17","18","19","20","8.4","9.0","9.1","9.2","9.3","9.4","9.5","9.6"],"Locales":["en","zh-Hans"],"Signatures":null,"Spellings":null,"SQLState":null,"Evidence":null}
