From: Alvaro Herrera <alvherre@2ndquadrant.com>
To: David G. Johnston <david.g.johnston@gmail.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Michael L Perry <michael@qedcode.com>
Cc: pgsql-docs@lists.postgresql.org
Subject: Re: 9.4. String Functions and Operators page does not document that encode adds line breaks
Date: Thu, 27 Feb 2020 15:32:56 -0300
Message-ID: <20200227183256.GA30538@alvherre.pgsql> (raw)
In-Reply-To: <CAKFQuwaJe6u-u4uSGtwSwgYkUfPSGLYkjCO+1Z_=WG937oraTQ@mail.gmail.com>
On 2020-Feb-09, David G. Johnston wrote:
> Stating direct RFC4648 compliance would require us to drop the line breaks
> that are only being added due to using MIME rules which ideally our general
> encoding function would not do. Greenfield we probably would want base64
> to be general RFC4648 and add something like base64-mime which performs the
> line breaking for the user per RFC 2045, base64-pem which would use that
> specific environments RFC rules. Now, maybe we can add "base64-4648" or
> "base64-general" while leaving "base64" alone and using the MIME version of
> the rules?
Patches welcome.
I'm not sure that we *need* to preserve the historical behavior. Many
people would probably be okay with encode('base64') returning no
newlines (since they are useless most of the time anyway), and the
minority that does can use encode('base64-rfc2045').
Another idea might be to add an optional 'flags' option to encode(),
which are given to the encoder/decoder functions.
--
Álvaro Herrera https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-docs@postgresql.org
Cc: alvherre@2ndquadrant.com, david.g.johnston@gmail.com, tgl@sss.pgh.pa.us, michael@qedcode.com, pgsql-docs@lists.postgresql.org
Subject: Re: 9.4. String Functions and Operators page does not document that encode adds line breaks
In-Reply-To: <20200227183256.GA30538@alvherre.pgsql>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox