Re: [HACKERS] bytea_output output of base64 - Mailing list pgsql-hackers

From Robert Haas
Subject Re: [HACKERS] bytea_output output of base64
Date
Msg-id CA+Tgmoab-JR0DK6Z+U9-Xz=R8m-FSdSAPBrM0vyOPS3uuHHFxA@mail.gmail.com
Whole thread Raw
In response to Re: [HACKERS] bytea_output output of base64  (Peter Eisentraut <peter.eisentraut@2ndquadrant.com>)
Responses Re: [HACKERS] bytea_output output of base64
List pgsql-hackers
On Mon, Feb 27, 2017 at 7:08 PM, Peter Eisentraut
<peter.eisentraut@2ndquadrant.com> wrote:
> On 2/26/17 05:05, Robert Haas wrote:
>> That having been said, I do agree with Tom's point that we already
>> have one more bytea_output format than would be ideal.  To justify
>> implementing base64 as a third choice, it would have to not only be
>> better than hex, but enough better to justify the migration pain.  I'm
>> not sure whether it could clear that bar.
>
> Another point is that an "output" format is not the same as an
> "encoding" format.  An output format should be somewhat human-readable.
> Otherwise we could find all kinds of more compact output formats for
> different data types.  The hex format satisfies all of performance, ease
> of use, and readability pretty well, I think.

Depends. I'd argue that 'dog' is more readable than '\x646f67',
although I concede that the latter is easier for a human to decode
than 'ZG9n'.

The Matrix nonwithstanding, if your binary blobs contain things like
JPG images, you probably want to feed the blobs to something that can
render them as a picture, rather than trying to guess from either hex
or escape output whether you've got a blond, brunette, or redhead.  In
the case where you do happen to want your binary blob rendered as
ASCII, the optimal format probably depends on some mix of what the
underlying data is, what you plan to do with the result, and personal
preference.  I think we might as well argue about whether green is
better than yellow.

I don't think Bruce was seriously proposing a change in this area
anyway.  I think he was just asking a question.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: [HACKERS] port of INSTALL file generation to XSLT
Next
From: Konstantin Knizhnik
Date:
Subject: [HACKERS] Two questions about Postgres parser