{"Entry":{"collection":"guc","key":"server_version_num","name":"server_version_num","aliases":[],"metadata":{"baseline":false,"boot_human":"Not specified","boot_val":null,"category":"Preset Options","category_zh":"","changed_in":["9.1","9.2","9.3","9.4","9.5","9.6","10","11","12","13","14","15","16","17","18","19"],"changes":[{"documentation_changed":false,"fields":{},"from":"8.1","status":"added","to":"8.2"},{"documentation_changed":false,"fields":{"boot_val":{"from":"90023","to":"90124"},"max_val":{"from":"90023","to":"90124"},"min_val":{"from":"90023","to":"90124"}},"from":"9.0","status":"changed","to":"9.1"},{"documentation_changed":false,"fields":{"boot_val":{"from":"90124","to":"90223"},"max_val":{"from":"90124","to":"90223"},"min_val":{"from":"90124","to":"90223"}},"from":"9.1","status":"changed","to":"9.2"},{"documentation_changed":false,"fields":{"boot_val":{"from":"90223","to":"90325"},"max_val":{"from":"90223","to":"90325"},"min_val":{"from":"90223","to":"90325"}},"from":"9.2","status":"changed","to":"9.3"},{"documentation_changed":false,"fields":{"boot_val":{"from":"90325","to":"90426"},"max_val":{"from":"90325","to":"90426"},"min_val":{"from":"90325","to":"90426"}},"from":"9.3","status":"changed","to":"9.4"},{"documentation_changed":false,"fields":{"boot_val":{"from":"90426","to":"90525"},"max_val":{"from":"90426","to":"90525"},"min_val":{"from":"90426","to":"90525"}},"from":"9.4","status":"changed","to":"9.5"},{"documentation_changed":false,"fields":{"boot_val":{"from":"90525","to":"90624"},"max_val":{"from":"90525","to":"90624"},"min_val":{"from":"90525","to":"90624"}},"from":"9.5","status":"changed","to":"9.6"},{"documentation_changed":false,"fields":{"boot_val":{"from":"90624","to":"100023"},"max_val":{"from":"90624","to":"100023"},"min_val":{"from":"90624","to":"100023"}},"from":"9.6","status":"changed","to":"10"},{"documentation_changed":false,"fields":{"boot_val":{"from":"100023","to":"110022"},"max_val":{"from":"100023","to":"110022"},"min_val":{"from":"100023","to":"110022"}},"from":"10","status":"changed","to":"11"},{"documentation_changed":false,"fields":{"boot_val":{"from":"110022","to":"120022"},"max_val":{"from":"110022","to":"120022"},"min_val":{"from":"110022","to":"120022"}},"from":"11","status":"changed","to":"12"},{"documentation_changed":false,"fields":{"boot_val":{"from":"120022","to":"130023"},"max_val":{"from":"120022","to":"130023"},"min_val":{"from":"120022","to":"130023"}},"from":"12","status":"changed","to":"13"},{"documentation_changed":false,"fields":{"boot_val":{"from":"130023","to":"140024"},"max_val":{"from":"130023","to":"140024"},"min_val":{"from":"130023","to":"140024"}},"from":"13","status":"changed","to":"14"},{"documentation_changed":false,"fields":{"boot_val":{"from":"140024","to":"150019"},"max_val":{"from":"140024","to":"150019"},"min_val":{"from":"140024","to":"150019"}},"from":"14","status":"changed","to":"15"},{"documentation_changed":false,"fields":{"boot_val":{"from":"150019","to":"160015"},"max_val":{"from":"150019","to":"160015"},"min_val":{"from":"150019","to":"160015"}},"from":"15","status":"changed","to":"16"},{"documentation_changed":false,"fields":{"boot_val":{"from":"160015","to":"170011"},"max_val":{"from":"160015","to":"170011"},"min_val":{"from":"160015","to":"170011"}},"from":"16","status":"changed","to":"17"},{"documentation_changed":false,"fields":{"boot_val":{"from":"170011","to":"180006"},"max_val":{"from":"170011","to":"180006"},"min_val":{"from":"170011","to":"180006"}},"from":"17","status":"changed","to":"18"},{"documentation_changed":false,"fields":{"boot_val":{"from":"180006","to":"190000"},"max_val":{"from":"180006","to":"190000"},"min_val":{"from":"180006","to":"190000"}},"from":"18","status":"changed","to":"19"}],"content_hash":"851638a8a66598c604d367d8d52a8d5032ff418bd7ca511040074898dd6c57cb","context":"","default_changed_in":["9.1","9.2","9.3","9.4","9.5","9.6","10","11","12","13","14","15","16","17","18","19"],"default_history":[{"from":"9.0","to":"9.0","value":"90023"},{"from":"9.1","to":"9.1","value":"90124"},{"from":"9.2","to":"9.2","value":"90223"},{"from":"9.3","to":"9.3","value":"90325"},{"from":"9.4","to":"9.4","value":"90426"},{"from":"9.5","to":"9.5","value":"90525"},{"from":"9.6","to":"9.6","value":"90624"},{"from":"10","to":"10","value":"100023"},{"from":"11","to":"11","value":"110022"},{"from":"12","to":"12","value":"120022"},{"from":"13","to":"13","value":"130023"},{"from":"14","to":"14","value":"140024"},{"from":"15","to":"15","value":"150019"},{"from":"16","to":"16","value":"160015"},{"from":"17","to":"17","value":"170011"},{"from":"18","to":"18","value":"180006"},{"from":"19","to":"19","value":"190000"}],"editorial":{"advice":{"olap":"Verify coordinator, workers, replicas, and extension builds against the actual server version before enabling version-specific SQL or planner features.","oltp":"Not tunable. Record it from every server after upgrade and use numeric comparisons in deployment checks; changing it means running a different PostgreSQL binary.","small":"Use the value for simple compatibility checks, but prefer probing the required feature. Do not attempt to alter it through configuration or initdb."},"mechanism":["Reports the running server binary’s version as an integer. It is internal/read-only and is determined by the binary, not by initdb or database creation.","For the measured PG9.0–19 Beta 3 releases, the integer encodes the major version and minor update so software can make numeric feature/version comparisons without parsing vendor text from server_version.","Use it for compatibility gating only when server-side feature discovery is unavailable. Extensions and clients must still account for vendor backports that do not change the upstream version number."],"pitfalls":["Comparing the integer as a string.","Trying to change it with configuration or by recreating a database.","Assuming the number captures vendor backports and downstream patches.","Using a client-library version as a substitute for the connected server version."],"references":[{"title":"PostgreSQL 19 Beta 4: server_version_num","url":"https://www.postgresql.org/docs/19/runtime-config-preset.html#GUC-SERVER-VERSION-NUM"},{"title":"PostgreSQL 19 release notes","url":"https://www.postgresql.org/docs/19/release-19.html"}],"related":["server_version","server_encoding","integer_datetimes","ssl_library","max_identifier_length","block_size"],"summary":"server_version_num — Shows the server version as an integer. Observed in PG9.0–19 Beta 4; its last measured boot default is 190000 in PG19 Beta 4, with internal context. This is a beta-snapshot fact and can change before PostgreSQL 19 GA."},"enumvals":[],"first_version":"8.2","group":"Preset Options","group_slug":"preset","imported_at":"2026-09-27T17:57:31.951619+08:00","intro_commit":{},"key":"server_version_num","last_version":"20","max_val":"","min_val":"","name":"server_version_num","position":354,"present_in":["8.2","8.3","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"],"short_desc":"Reports the version number of the server as an integer.","short_desc_zh":"","source_rev":"english-manuals:2207366be4d31c80868180643e55ea97f9ab93f11fa4e84f33435f557a513c11","unit":"","vartype":"integer"}},"Definition":{"Collection":"guc","Key":"server_version_num","SourceDatabase":"center","Version":"18","SourceTable":"guc","SourceKey":"server_version_num","SourceRevision":"english-manuals:2207366be4d31c80868180643e55ea97f9ab93f11fa4e84f33435f557a513c11","Facts":{"boot_val":"180006","category":"Preset Options","context":"internal","description":"Reports the version number of the server as an integer. It is determined by the value of PG_VERSION_NUM when building the server.","doc":{"anchor":"GUC-SERVER-VERSION-NUM","file":"runtime-config-preset.html","lang":"en","sha256":"4dbfec727b9cee838adefb8a766217748d91ab90190b452a58cec737459582ce","slug":"18"},"documented":true,"enumvals":null,"extra_desc":null,"lang":"en","max_val":"180006","metadata_version":"18","min_val":"180006","name":"server_version_num","short_desc":"Shows the server version as an integer.","source":"pg-settings-source-snapshot","unit":null,"vartype":"integer"},"ManualEvidence":{"doc":{"anchor":"GUC-SERVER-VERSION-NUM","file":"runtime-config-preset.html","lang":"en","sha256":"4dbfec727b9cee838adefb8a766217748d91ab90190b452a58cec737459582ce","slug":"18"}},"MeasuredEvidence":{"metadata_version":"18"}},"Text":{"Collection":"guc","Key":"server_version_num","SourceDatabase":"center","Version":"18","Locale":"en","Title":"server_version_num","Summary":"Reports the version number of the server as an integer. It is determined by the value of PG_VERSION_NUM when building the server.","BodyHTML":"\u003cp\u003eReports the version number of the server as an integer. It is determined by the value of PG_VERSION_NUM when building the server.\u003c/p\u003e","SourceRevision":"english-manuals:2207366be4d31c80868180643e55ea97f9ab93f11fa4e84f33435f557a513c11","ContentHash":"7d43a358a64ddeaafbf608373a123d387a56217b2c55737922d32b0397539da3","Payload":{"description":"Reports the version number of the server as an integer. It is determined by the value of PG_VERSION_NUM when building the server."}},"RequestedLocale":"zh-Hans","Fallback":true,"Versions":["10","11","12","13","14","15","16","17","18","19","20","8.2","8.3","8.4","9.0","9.1","9.2","9.3","9.4","9.5","9.6"],"Locales":["en"],"Signatures":null,"Spellings":null,"SQLState":null,"Evidence":null}
