Re: bytea_output output of base64

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>
Cc: Bruce Momjian <bruce(at)momjian(dot)us>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: bytea_output output of base64
Date: 2017-02-27 15:58:10
Message-ID: CA+Tgmoab-JR0DK6Z+U9-Xz=R8m-FSdSAPBrM0vyOPS3uuHHFxA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Feb 27, 2017 at 7:08 PM, Peter Eisentraut
<peter(dot)eisentraut(at)2ndquadrant(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Konstantin Knizhnik 2017-02-27 16:07:54 Two questions about Postgres parser
Previous Message Peter Eisentraut 2017-02-27 15:55:42 Re: port of INSTALL file generation to XSLT