{"Entry":{"collection":"guc","key":"xmloption","name":"xmloption","aliases":[],"metadata":{"baseline":false,"boot_human":"Not specified","boot_val":null,"category":"Client Connection Defaults / Statement Behavior","category_zh":"","changed_in":[],"changes":[{"documentation_changed":false,"fields":{},"from":"8.2","status":"added","to":"8.3"}],"content_hash":"68b02834b8a9347609d66580870283e8689db695735274648882781ae839c6c5","context":"","default_changed_in":[],"default_history":[{"from":"9.0","to":"19","value":"content"}],"derived_content_hash":"bf9861d7ac2ef34be74587ba2c011b1a3ebd4bf240242d610e59c926eaa34357","editorial":{"advice":{"olap":"Pin xmloption for export, reporting, and reproducible analytical jobs; prefer explicit SQL formatting when a file or API has a durable schema.","oltp":"Treat xmloption as an application contract, not a performance knob. Standardize it per role or connection pool and keep wire formats explicit where clients parse text.","small":"Keep the upstream or locale-derived value unless a client requires another one. A smaller server gains no capacity from changing xmloption."},"mechanism":["xmloption sets whether XML data in implicit parsing and serialization operations is to be considered as documents or content fragments. CONTENT permits XML fragments while DOCUMENT requires a single well-formed XML document, changing implicit casts and serialization behavior.","xmloption is a USER-context setting. An authorized role can change it for a session, while ALTER ROLE or ALTER DATABASE can establish a default for future sessions.","It changes representation, parsing, or locale behavior at the client boundary rather than physical storage. Coordinate it with the other locale and formatting settings and with driver-native binary or typed protocols."],"pitfalls":["Changing xmloption in one session and assuming role defaults, database defaults, or other pooled sessions changed with it.","Assuming a presentation setting changes stored values or server-side type semantics.","Changing a role or database default without testing text-parsing clients, exports, and pooled sessions.","Changing xmloption globally without a rollback plan and a client or operational compatibility test."],"references":[{"title":"PostgreSQL 19 Beta 4: xmloption","url":"https://www.postgresql.org/docs/19/runtime-config-client.html#GUC-XMLOPTION"},{"title":"PostgreSQL 19 release notes","url":"https://www.postgresql.org/docs/19/release-19.html"}],"related":["bytea_output","extra_float_digits","xmlbinary","client_encoding","DateStyle"],"summary":"xmloption is the PostgreSQL setting that defines whether XML data in implicit parsing and serialization operations is to be considered as documents or content fragments."},"enumvals":[],"first_version":"8.3","group":"Client Connection Defaults","group_slug":"client","imported_at":"2026-09-27T17:57:32.397174+08:00","intro_commit":{},"key":"xmloption","last_version":"20","max_val":"","min_val":"","name":"xmloption","position":489,"present_in":["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:6488cefabfa18fee89133ee39a4f15b07bfbbcf59a75850a012f120556cf73bb","receipt_sha256":"5104eea47fea706d85c34eab7a3e7881f4a7abb734d1e643a5541a87334f2ee6","repair":"wiki-repair-20261023"},"short_desc":"Sets whether DOCUMENT or CONTENT is implicit when converting between XML and character string values.","short_desc_zh":"","source_rev":"wiki-repair-20261023:f9a604b10b134abfcb80cf14c52954e441ce18ad31925e1122a7cb51fd5719df","unit":"","vartype":"enum"}},"Definition":{"Collection":"guc","Key":"xmloption","SourceDatabase":"center","Version":"18","SourceTable":"guc","SourceKey":"xmloption","SourceRevision":"wiki-repair-20261023:f9a604b10b134abfcb80cf14c52954e441ce18ad31925e1122a7cb51fd5719df","Facts":{"boot_val":"content","category":"Client Connection Defaults / Statement Behavior","context":"user","description":"Sets whether DOCUMENT or CONTENT is implicit when converting between XML and character string values. See Section 8.13 for a description of this. Valid values are DOCUMENT and CONTENT. The default is CONTENT. According to the SQL standard, the command to set this option is SET XML OPTION { DOCUMENT | CONTENT }; This syntax is also available in PostgreSQL.","description_zh":"设置在 XML 与字符串值之间进行转换时，隐含采用 DOCUMENT 还是 CONTENT。有关说明参见第 8.13 节。有效值是 DOCUMENT 和 CONTENT。默认值是 CONTENT。 根据 SQL 标准，设置这个选项的命令是： SET XML OPTION { DOCUMENT | CONTENT }; 这种语法在 PostgreSQL 也可用。","description_zh_html":"\u003cp\u003e\n        设置在 XML 与字符串值之间进行转换时，隐含采用 \u003ccode class=\"literal\"\u003eDOCUMENT\u003c/code\u003e 还是 \u003ccode class=\"literal\"\u003eCONTENT\u003c/code\u003e。有关说明参见\u003ca class=\"xref\" href=\"/zh/docs/18/datatype-xml.html\" title=\"8.13. XML类型\"\u003e第 8.13 节\u003c/a\u003e。有效值是 \u003ccode class=\"literal\"\u003eDOCUMENT\u003c/code\u003e 和 \u003ccode class=\"literal\"\u003eCONTENT\u003c/code\u003e。默认值是 \u003ccode class=\"literal\"\u003eCONTENT\u003c/code\u003e。\n       \u003c/p\u003e\u003cp\u003e\n        根据 SQL 标准，设置这个选项的命令是：\n\u003c/p\u003e\u003cpre class=\"synopsis\"\u003e\nSET XML OPTION { DOCUMENT | CONTENT };\n\u003c/pre\u003e\u003cp\u003e\n        这种语法在 PostgreSQL 也可用。\n       \u003c/p\u003e","doc":{"anchor":"GUC-XMLOPTION","file":"runtime-config-client.html","lang":"en","sha256":"6be6cc70f29eca4695dc43b2b2b94c75b7e0eaaa2c00273d7a98488917a7edb7","slug":"18"},"documented":true,"enumvals":["content","document"],"extra_desc":null,"lang":"en","max_val":null,"metadata_version":"18","min_val":null,"name":"xmloption","short_desc":"Sets whether XML data in implicit parsing and serialization operations is to be considered as documents or content fragments.","source":"pg-settings-source-snapshot","translation_provenance":{"inputs":[{"kind":"current-pgdoc-translation","path":"/Users/vonng/pgsty/pgdoc/zh/18/html/runtime-config-client.html","sha256":"1882f8fd5576909c4fcc44af53077378871e05f5be67723f20fe300273024767"}],"kind":"same-version-pgdoc","locale":"zh-Hans","source_revision":"b1b500221dbe5437cfca004d6b04d3f6e422765d","version":"18"},"unit":null,"vartype":"enum","zh_from":"same-version-pgdoc"},"ManualEvidence":{"doc":{"anchor":"GUC-XMLOPTION","file":"runtime-config-client.html","lang":"en","sha256":"6be6cc70f29eca4695dc43b2b2b94c75b7e0eaaa2c00273d7a98488917a7edb7","slug":"18"}},"MeasuredEvidence":{"metadata_version":"18"}},"Text":{"Collection":"guc","Key":"xmloption","SourceDatabase":"center","Version":"18","Locale":"en","Title":"xmloption","Summary":"Sets whether DOCUMENT or CONTENT is implicit when converting between XML and character string values. See Section 8.13 for a description of this. Valid values are DOCUMENT and CONTENT. The default is CONTENT. According to the SQL standard, the command to set this option is SET XML OPTION { DOCUMENT | CONTENT }; This syntax is also available in PostgreSQL.","BodyHTML":"\u003cp\u003eSets whether DOCUMENT or CONTENT is implicit when converting between XML and character string values. See Section 8.13 for a description of this. Valid values are DOCUMENT and CONTENT. The default is CONTENT. According to the SQL standard, the command to set this option is SET XML OPTION { DOCUMENT | CONTENT }; This syntax is also available in PostgreSQL.\u003c/p\u003e","SourceRevision":"wiki-repair-20261023:f9a604b10b134abfcb80cf14c52954e441ce18ad31925e1122a7cb51fd5719df","ContentHash":"9b38ff92aff7810e6e02aaadba22e36a7de2f16c643ecc7f01d32c93b8ef5163","Payload":{"description":"Sets whether DOCUMENT or CONTENT is implicit when converting between XML and character string values. See Section 8.13 for a description of this. Valid values are DOCUMENT and CONTENT. The default is CONTENT. According to the SQL standard, the command to set this option is SET XML OPTION { DOCUMENT | CONTENT }; This syntax is also available in PostgreSQL."}},"RequestedLocale":"en","Fallback":false,"Versions":["10","11","12","13","14","15","16","17","18","19","20","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}
