DB Internals AtlasPostgreSQL 18.6 Home About

Parameter · Client Connection Defaults / Statement Behavior

xmlbinary

Sets how binary values are to be encoded in XML.

  • Default: base64
  • Type: enum
  • Values: base64 · hex
  • Applies: Session (any user)

In plain words

XML cannot contain raw bytes, so when you put a bytea value into XML (for example with xmlelement), PostgreSQL encodes it as text. This setting picks base64 (default) or hex.

For DBAs and operators

Used by the XML functions (xmlelement, xmlforest, table_to_xml and related mapping functions) when they convert binary values. Both encodings correspond to XML Schema types (xs:base64Binary, xs:hexBinary). Choose what the consumer of the XML expects. It never affects the normal text output of bytea; that is bytea_output.

How to change it

Any user can change it for their session with SET.

Related parameters

xmloption bytea_output

All Client Connection Defaults parameters