WeSearch

Christophe Pettus: All Your GUCs in a Row: bytea_output

·3 min read · 0 reactions · 0 comments · 14 views
#postgresql#database#binary data
Christophe Pettus: All Your GUCs in a Row: bytea_output
⚡ TL;DR · AI summary

The article discusses the PostgreSQL configuration parameter bytea_output, which controls the format of binary data sent to clients. It highlights the differences between the hex and escape formats, with hex being the preferred option due to its efficiency and clarity. The article advises users to generally stick with hex, only using escape format in specific legacy scenarios.

Key facts
Original article
Postgr
Read full at Postgr →
Opening excerpt (first ~120 words) tap to expand

2026-05-19 3 min PostgreSQL All Your GUCs in a Row: bytea_output bytea_output controls how PostgreSQL formats binary data when sending it to a client. Two values: hex (the default since PostgreSQL 9.0, released in 2010) and escape (the traditional format, dating back to the early 2000s). Context is user. The parameter affects output only — bytea input has accepted both formats forever, and a SET bytea_output setting changes nothing about how you write literal values. The two formats, given the same five-byte value: Copy1SET bytea_output = 'hex'; 2SELECT '\x48656c6c6f'::bytea; 3-- \x48656c6c6f 4 5SET bytea_output = 'escape'; 6SELECT '\x48656c6c6f'::bytea; 7-- Hello Why the format changed The escape format is the original PostgreSQL bytea representation: printable bytes as themselves,…

Excerpt limited to ~120 words for fair-use compliance. The full article is at Postgr.

Anonymous · no account needed
Share 𝕏 Facebook Reddit LinkedIn Threads WhatsApp Bluesky Mastodon Email

Discussion

0 comments

More from Postgr