{"Entry":{"collection":"guc","key":"xmlbinary","name":"xmlbinary","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"},{"documentation_changed":true,"fields":{},"from":"12","status":"changed","to":"13"},{"documentation_changed":true,"fields":{},"from":"18","status":"changed","to":"19"}],"content_hash":"1628cf88a959e889dc5036d7f3bc8c66ef2aa42388ec8321ddf65252e0ea11c4","context":"","default_changed_in":[],"default_history":[{"from":"9.0","to":"19","value":"base64"}],"editorial":{"advice":{"olap":"Pin xmlbinary for export, reporting, and reproducible analytical jobs; prefer explicit SQL formatting when a file or API has a durable schema.","oltp":"Treat xmlbinary 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 xmlbinary."},"mechanism":["xmlbinary sets how binary values are to be encoded in XML. It affects bytea-to-XML conversion by XML construction functions; both base64 and hex preserve all bytes, but hex output is larger.","xmlbinary 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 xmlbinary 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 xmlbinary globally without a rollback plan and a client or operational compatibility test."],"references":[{"title":"PostgreSQL 19 Beta 4: xmlbinary","url":"https://www.postgresql.org/docs/19/runtime-config-client.html#GUC-XMLBINARY"},{"title":"PostgreSQL 19 release notes","url":"https://www.postgresql.org/docs/19/release-19.html"}],"related":["bytea_output","extra_float_digits","xmloption","client_encoding","DateStyle"],"summary":"xmlbinary is the PostgreSQL setting that defines how binary values are to be encoded in XML."},"enumvals":[],"first_version":"8.3","group":"Client Connection Defaults","group_slug":"client","imported_at":"2026-09-27T17:57:32.393841+08:00","intro_commit":{},"key":"xmlbinary","last_version":"20","max_val":"","min_val":"","name":"xmlbinary","position":488,"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"],"short_desc":"Sets how binary values are to be encoded in XML.","short_desc_zh":"","source_rev":"english-manuals:edca736de8fc4087ca75de663be43f8ccb73e1499a3659b15361d1d7baeaab77","unit":"","vartype":"enum"}},"Definition":{"Collection":"guc","Key":"xmlbinary","SourceDatabase":"center","Version":"18","SourceTable":"guc","SourceKey":"xmlbinary","SourceRevision":"english-manuals:edca736de8fc4087ca75de663be43f8ccb73e1499a3659b15361d1d7baeaab77","Facts":{"boot_val":"base64","category":"Client Connection Defaults / Statement Behavior","context":"user","description":"Sets how binary values are to be encoded in XML. This applies for example when bytea values are converted to XML by the functions xmlelement or xmlforest. Possible values are base64 and hex, which are both defined in the XML Schema standard. The default is base64. For further information about XML-related functions, see Section 9.15. The actual choice here is mostly a matter of taste, constrained only by possible restrictions in client applications. Both methods support all possible values, although the hex encoding will be somewhat larger than the base64 encoding.","doc":{"anchor":"GUC-XMLBINARY","file":"runtime-config-client.html","lang":"en","sha256":"6be6cc70f29eca4695dc43b2b2b94c75b7e0eaaa2c00273d7a98488917a7edb7","slug":"18"},"documented":true,"enumvals":["base64","hex"],"extra_desc":null,"lang":"en","max_val":null,"metadata_version":"18","min_val":null,"name":"xmlbinary","short_desc":"Sets how binary values are to be encoded in XML.","source":"pg-settings-source-snapshot","unit":null,"vartype":"enum"},"ManualEvidence":{"doc":{"anchor":"GUC-XMLBINARY","file":"runtime-config-client.html","lang":"en","sha256":"6be6cc70f29eca4695dc43b2b2b94c75b7e0eaaa2c00273d7a98488917a7edb7","slug":"18"}},"MeasuredEvidence":{"metadata_version":"18"}},"Text":{"Collection":"guc","Key":"xmlbinary","SourceDatabase":"pgweb","Version":"18","Locale":"zh-Hans","Title":"xmlbinary","Summary":"","BodyHTML":"\u003cp\u003e设置二进制值如何被编码为 XML。例如，这适用于通过\u003ccode\u003exmlelement\u003c/code\u003e函数或\u003ccode\u003exmlforest\u003c/code\u003e函数将\u003ccode\u003ebytea\u003c/code\u003e值转换到 XML 值。可能的值有\u003ccode\u003ebase64\u003c/code\u003e和\u003ccode\u003ehex\u003c/code\u003e，它们都是用 XML 模式标准定义的。默认值是\u003ccode\u003ebase64\u003c/code\u003e。更多关于 XML 相关函数的信息可参阅\u003ca href=\"/docs/18/functions-xml.html\" rel=\"nofollow\"\u003e第 9.15 节\u003c/a\u003e。\u003c/p\u003e\u003cp\u003e这里的实际选择主要取决于偏好，只受客户端应用中可能存在的限制的约束。两种方法都支持所有可能的值，尽管十六进制编码会比 base64 编码略大。\u003c/p\u003e","SourceRevision":"2026-09-11@29c86d9","ContentHash":"c8023973c29f702922bb0b4c976efcbca546fc58ec6fa68b4d62bca510240f8a","Payload":{"carried_from":"","carry_reason":"","doc_html":"\u003cp\u003e设置二进制值如何被编码为 XML。例如，这适用于通过\u003ccode class=\"function\"\u003exmlelement\u003c/code\u003e函数或\u003ccode class=\"function\"\u003exmlforest\u003c/code\u003e函数将\u003ccode class=\"type\"\u003ebytea\u003c/code\u003e值转换到 XML 值。可能的值有\u003ccode class=\"literal\"\u003ebase64\u003c/code\u003e和\u003ccode class=\"literal\"\u003ehex\u003c/code\u003e，它们都是用 XML 模式标准定义的。默认值是\u003ccode class=\"literal\"\u003ebase64\u003c/code\u003e。更多关于 XML 相关函数的信息可参阅\u003ca href=\"/docs/18/functions-xml.html\" title=\"9.15. XML 函数\"\u003e第 9.15 节\u003c/a\u003e。\u003c/p\u003e\u003cp\u003e这里的实际选择主要取决于偏好，只受客户端应用中可能存在的限制的约束。两种方法都支持所有可能的值，尽管十六进制编码会比 base64 编码略大。\u003c/p\u003e","doc_same_as":""}},"RequestedLocale":"zh-Hans","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}
