{"Entry":{"collection":"guc","key":"server_encoding","name":"server_encoding","aliases":[],"metadata":{"baseline":false,"boot_human":"Not specified","boot_val":null,"category":"Preset Options","category_zh":"","changed_in":["14"],"changes":[{"documentation_changed":false,"fields":{},"from":"7.4","status":"added","to":"8.0"},{"documentation_changed":true,"fields":{},"from":"8.0","status":"changed","to":"8.1"},{"documentation_changed":false,"fields":{"category":{"from":"Client Connection Defaults / Locale and Formatting","to":"Preset Options"},"short_desc":{"from":"Sets the server (database) character set encoding.","to":"Shows the server (database) character set encoding."}},"from":"13","status":"changed","to":"14"}],"content_hash":"2f595cf8ded710a1358a0a0a0a34762e4c4390099c6fdf415f69d7a7826a4f70","context":"","default_changed_in":[],"default_history":[{"from":"9.0","to":"19","value":"SQL_ASCII"}],"derived_content_hash":"8e6b17f2015f67b0a021781dd30d9648595012837afcd421976624dd599c8bee","editorial":{"advice":{"olap":"Not tunable. Use server_encoding to verify format, build, or resource assumptions on analytical nodes and keep every read/write candidate compatible.","oltp":"Not tunable. Record server_encoding 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 server (database) character set encoding. It is read-only and cannot be changed with SET or configuration-file edits.","It reports the current database encoding. Encoding is selected at database creation and can differ between databases in a cluster.","Interpret it with lc_collate, lc_ctype, client_encoding. Applications and operations tooling may read server_encoding 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 server_encoding 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: server_encoding","url":"https://www.postgresql.org/docs/19/runtime-config-preset.html#GUC-SERVER-ENCODING"},{"title":"PostgreSQL 19 release notes","url":"https://www.postgresql.org/docs/19/release-19.html"}],"related":["lc_collate","lc_ctype","client_encoding","default_text_search_config","icu_validation_level","server_version"],"summary":"server_encoding — Shows the server (database) character set encoding. Observed in PG9.0–19 Beta 4; its last measured boot default is SQL_ASCII in PG19 Beta 4, with internal context. This is a beta-snapshot fact and can change before PostgreSQL 19 GA."},"enumvals":[],"first_version":"8.0","group":"Preset Options","group_slug":"preset","imported_at":"2026-09-27T17:57:31.945387+08:00","intro_commit":{},"key":"server_encoding","last_version":"20","max_val":"","min_val":"","name":"server_encoding","position":352,"present_in":["8.0","8.1","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"],"repair_provenance":{"original_source_revision":"english-manuals:3e5d722be6dab50fb59e246a4ba53e45e30a8cb003e467838db8467d94cdbe11","receipt_sha256":"711c9ad0e314ea8fa7f2c21f52bfced183df495f646f9970767b15c2a25b8ff6","repair":"wiki-repair-20261023"},"short_desc":"Reports the database encoding (character set).","short_desc_zh":"","source_rev":"wiki-repair-20261023:5623112f63df48e42804a61f02c15c448163248071deef83c1855282ba90a057","unit":"","vartype":"string"}},"Definition":{"Collection":"guc","Key":"server_encoding","SourceDatabase":"center","Version":"18","SourceTable":"guc","SourceKey":"server_encoding","SourceRevision":"wiki-repair-20261023:5623112f63df48e42804a61f02c15c448163248071deef83c1855282ba90a057","Facts":{"boot_val":"SQL_ASCII","category":"Preset Options","context":"internal","description":"Reports the database encoding (character set). It is determined when the database is created. Ordinarily, clients need only be concerned with the value of client_encoding.","description_zh":"报告数据库的编码（字符集）。这是在数据库被创建时决定的。通常，客户端只需要关心 client_encoding 的值。","description_zh_html":"\u003cp\u003e\n        报告数据库的编码（字符集）。这是在数据库被创建时决定的。通常，客户端只需要关心 \u003ca class=\"xref\" href=\"/zh/docs/18/runtime-config-client.html#GUC-CLIENT-ENCODING\"\u003eclient_encoding\u003c/a\u003e 的值。\n       \u003c/p\u003e","doc":{"anchor":"GUC-SERVER-ENCODING","file":"runtime-config-preset.html","lang":"en","sha256":"4dbfec727b9cee838adefb8a766217748d91ab90190b452a58cec737459582ce","slug":"18"},"documented":true,"enumvals":null,"extra_desc":null,"lang":"en","max_val":null,"metadata_version":"18","min_val":null,"name":"server_encoding","short_desc":"Shows the server (database) character set encoding.","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":null,"vartype":"string","zh_from":"same-version-pgdoc"},"ManualEvidence":{"doc":{"anchor":"GUC-SERVER-ENCODING","file":"runtime-config-preset.html","lang":"en","sha256":"4dbfec727b9cee838adefb8a766217748d91ab90190b452a58cec737459582ce","slug":"18"}},"MeasuredEvidence":{"metadata_version":"18"}},"Text":{"Collection":"guc","Key":"server_encoding","SourceDatabase":"center","Version":"18","Locale":"en","Title":"server_encoding","Summary":"Reports the database encoding (character set). It is determined when the database is created. Ordinarily, clients need only be concerned with the value of client_encoding.","BodyHTML":"\u003cp\u003eReports the database encoding (character set). It is determined when the database is created. Ordinarily, clients need only be concerned with the value of client_encoding.\u003c/p\u003e","SourceRevision":"wiki-repair-20261023:5623112f63df48e42804a61f02c15c448163248071deef83c1855282ba90a057","ContentHash":"5d71ec8aebd4a1f2999093e2d6950045751a74acba6d7779fd2afece9a369dba","Payload":{"description":"Reports the database encoding (character set). It is determined when the database is created. Ordinarily, clients need only be concerned with the value of client_encoding."}},"RequestedLocale":"en","Fallback":false,"Versions":["10","11","12","13","14","15","16","17","18","19","20","8.0","8.1","8.2","8.3","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}
