On Mon, Jun 13, 2011 at 1:58 AM, Craig Ringer
<craig@postnewspapers.com.au> wrote:
> On 13/06/11 09:27, Merlin Moncure wrote:
>
>> want to use the binary protocol mode (especially for postgres versions
>> that don't support hex mode)
>
> Allowing myself to get a wee bit sidetracked:
>
> I've been wondering lately why hex was chosen as the new input/output
> format when the bytea_output change went in. The Base64 encoding is
> trivial to implement, already supported by standard libraries for many
> languages and add-ons for the rest, fast to encode/decode, and much more
> compact than a hex encoding, so it seems like a more attractive option.
> PostgreSQL already supports base64 in explicit 'escape()' calls.
yeah -- I remember the discussion. I think the bottom line is that
hex is just simpler all around. This conveys a number of small
advantages that, when added up, outweigh the slightly better space
efficiency.
merlin