{"Entry":{"collection":"guc","key":"bytea_output","name":"bytea_output","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.4","status":"added","to":"9.0"}],"content_hash":"10919572800078fef566bb5454df4f608979eae8ac33a78a5986c7756491f786","context":"","default_changed_in":[],"default_history":[{"from":"9.0","to":"19","value":"hex"}],"editorial":{"advice":{"olap":"Pin bytea_output for export, reporting, and reproducible analytical jobs; prefer explicit SQL formatting when a file or API has a durable schema.","oltp":"Treat bytea_output 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 bytea_output."},"mechanism":["bytea_output sets the output format for bytea. The choice affects textual output only: bytea input accepts both hex and escape syntax regardless of this setting.","bytea_output 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 bytea_output 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 bytea_output globally without a rollback plan and a client or operational compatibility test."],"references":[{"title":"PostgreSQL 19 Beta 4: bytea_output","url":"https://www.postgresql.org/docs/19/runtime-config-client.html#GUC-BYTEA-OUTPUT"},{"title":"PostgreSQL 19 release notes","url":"https://www.postgresql.org/docs/19/release-19.html"}],"related":["extra_float_digits","xmlbinary","xmloption","client_encoding","DateStyle"],"summary":"bytea_output is the PostgreSQL setting that defines the output format for bytea."},"enumvals":[],"first_version":"9.0","group":"Client Connection Defaults","group_slug":"client","imported_at":"2026-09-27T17:57:30.912057+08:00","intro_commit":{},"key":"bytea_output","last_version":"20","max_val":"","min_val":"","name":"bytea_output","position":53,"present_in":["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 the output format for values of type bytea.","short_desc_zh":"","source_rev":"english-manuals:c37409ff3f9056b020c7fcf09924f2fc8a72ba266e91f0dc485e095d5369b4c4","unit":"","vartype":"enum"}},"Definition":{"Collection":"guc","Key":"bytea_output","SourceDatabase":"center","Version":"18","SourceTable":"guc","SourceKey":"bytea_output","SourceRevision":"english-manuals:c37409ff3f9056b020c7fcf09924f2fc8a72ba266e91f0dc485e095d5369b4c4","Facts":{"boot_val":"hex","category":"Client Connection Defaults / Statement Behavior","context":"user","description":"Sets the output format for values of type bytea. Valid values are hex (the default) and escape (the traditional PostgreSQL format). See Section 8.4 for more information. The bytea type always accepts both formats on input, regardless of this setting.","doc":{"anchor":"GUC-BYTEA-OUTPUT","file":"runtime-config-client.html","lang":"en","sha256":"6be6cc70f29eca4695dc43b2b2b94c75b7e0eaaa2c00273d7a98488917a7edb7","slug":"18"},"documented":true,"enumvals":["escape","hex"],"extra_desc":null,"lang":"en","max_val":null,"metadata_version":"18","min_val":null,"name":"bytea_output","short_desc":"Sets the output format for bytea.","source":"pg-settings-source-snapshot","unit":null,"vartype":"enum"},"ManualEvidence":{"doc":{"anchor":"GUC-BYTEA-OUTPUT","file":"runtime-config-client.html","lang":"en","sha256":"6be6cc70f29eca4695dc43b2b2b94c75b7e0eaaa2c00273d7a98488917a7edb7","slug":"18"}},"MeasuredEvidence":{"metadata_version":"18"}},"Text":{"Collection":"guc","Key":"bytea_output","SourceDatabase":"pgweb","Version":"18","Locale":"zh-Hans","Title":"bytea_output","Summary":"","BodyHTML":"\u003cp\u003e设置\u003ccode\u003ebytea\u003c/code\u003e类型值的输出格式。有效值是\u003ccode\u003ehex\u003c/code\u003e（默认）和 \u003ccode\u003eescape\u003c/code\u003e（传统的 PostgreSQL 格式）。详见\u003ca href=\"/docs/18/datatype-binary.html\" rel=\"nofollow\"\u003e第 8.4 节\u003c/a\u003e。不管这个设置的值如何，\u003ccode\u003ebytea\u003c/code\u003e类型总是接受这两种格式的输入。\u003c/p\u003e","SourceRevision":"2026-09-11@29c86d9","ContentHash":"19d86999df96a8045b102ff52e01d5aaccc54099224a7038d10ab1fa65112875","Payload":{"carried_from":"","carry_reason":"","doc_html":"\u003cp\u003e设置\u003ccode class=\"type\"\u003ebytea\u003c/code\u003e类型值的输出格式。有效值是\u003ccode class=\"literal\"\u003ehex\u003c/code\u003e（默认）和 \u003ccode class=\"literal\"\u003eescape\u003c/code\u003e（传统的 PostgreSQL 格式）。详见\u003ca href=\"/docs/18/datatype-binary.html\" title=\"8.4. 二进制数据类型\"\u003e第 8.4 节\u003c/a\u003e。不管这个设置的值如何，\u003ccode class=\"type\"\u003ebytea\u003c/code\u003e类型总是接受这两种格式的输入。\u003c/p\u003e","doc_same_as":""}},"RequestedLocale":"zh-Hans","Fallback":false,"Versions":["10","11","12","13","14","15","16","17","18","19","20","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}
