PG Doc comments form <nore...@postgresql.org> writes:
> It took me a long time to discover why a base 64 encoded SHA-512 hash was 89
> characters long instead of the expected 88. The documentation does not
> mention that the encode function inserts newlines after 76 characters.
> Please make a note of this behavior.

That was done a few weeks ago in HEAD:

https://www.postgresql.org/docs/devel/functions-binarystring.html

    The base64 format is that of RFC 2045 Section 6.8. As per the RFC,
    encoded lines are broken at 76 characters. However instead of the MIME
    CRLF end-of-line marker, only a newline is used for end-of-line. The
    decode function ignores carriage-return, newline, space, and tab
    characters. Otherwise, an error is raised when decode is supplied
    invalid base64 data — including when trailing padding is incorrect.

> By the way, this is a very poor design decision.

So far as I can tell, that RFC's requirement for line breaks has not
been removed by any later RFC.  So you're complaining to the wrong
people.

                        regards, tom lane


Reply via email to