Minor result error in binary strings documentation

Started by PG Bug reporting formalmost 6 years ago2 messagesdocs
Jump to latest
#1PG Bug reporting form
noreply@postgresql.org

The following documentation comment has been logged on the website:

Page: https://www.postgresql.org/docs/12/functions-binarystring.html
Description:

On the page:

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

The result for decode('123\000456', 'escape') is incorrect, it should be:

# select decode('123\000456', 'escape');
decode
------------------
\x31323300343536

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: PG Bug reporting form (#1)
Re: Minor result error in binary strings documentation

PG Doc comments form <noreply@postgresql.org> writes:

On the page:
https://www.postgresql.org/docs/12/functions-binarystring.html

The result for decode('123\000456', 'escape') is incorrect, it should be:

# select decode('123\000456', 'escape');
decode
------------------
\x31323300343536

The example is "correct" as given, because it assumes bytea_output is set
to escape, as noted at the top of the page. For v13, I have adjusted all
the examples on this page to follow the modern default of bytea_output =
hex, but I don't plan to retrofit the older branches that way.

regards, tom lane