From: Tom Lane Date: Fri, 29 Mar 2013 03:15:08 +0000 (-0400) Subject: Document encode(bytea, 'escape')'s behavior correctly. X-Git-Tag: REL8_4_17~4 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=dd3728db28a7c48a92a0116597a6040fb9d3d489;p=postgresql Document encode(bytea, 'escape')'s behavior correctly. I changed this in commit fd15dba543247eb1ce879d22632b9fdb4c230831, but missed the fact that the SGML documentation of the function specified exactly what it did. Well, one of the two places where it's specified documented that --- probably I looked at the other place and thought nothing needed to be done. Sync the two places where encode() and decode() are described. --- diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml index b9b6c9d7c4..e188626bec 100644 --- a/doc/src/sgml/func.sgml +++ b/doc/src/sgml/func.sgml @@ -1422,12 +1422,12 @@ decode(string text, - type text) + format text) bytea - Decode binary data from string previously - encoded with encode. Parameter type is same as in encode. + Decode binary data from textual representation in string. + Options for format are same as in encode. decode('MTIzAAE=', 'base64') 123\000\001 @@ -1436,13 +1436,14 @@ encode(data bytea, - type text) + format text) text - Encode binary data to different representation. Supported - types are: base64, hex, escape. - Escape merely outputs null bytes as \000 and + Encode binary data into a textual representation. Supported + formats are: base64, hex, escape. + escape converts zero bytes and high-bit-set bytes to + octal sequences (\nnn) and doubles backslashes. encode(E'123\\000\\001', 'base64') @@ -2780,12 +2781,12 @@ decode(string text, - type text) + format text) bytea - Decode binary string from string previously - encoded with encode. Parameter type is same as in encode. + Decode binary data from textual representation in string. + Options for format are same as in encode. decode(E'123\\000456', 'escape') 123\000456 @@ -2793,13 +2794,16 @@ - encode(string bytea, - type text) + encode(data bytea, + format text) text - Encode binary string to ASCII-only representation. Supported - types are: base64, hex, escape. + Encode binary data into a textual representation. Supported + formats are: base64, hex, escape. + escape converts zero bytes and high-bit-set bytes to + octal sequences (\nnn) and + doubles backslashes. encode(E'123\\000456'::bytea, 'escape') 123\000456