diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml
index db4e33f871d..a0ecc4f5685 100644
--- a/doc/src/sgml/func.sgml
+++ b/doc/src/sgml/func.sgml
@@ -1506,7 +1506,8 @@
Encode binary data into a textual representation. Supported
formats are: base64>, hex>, escape>.
- escape> merely outputs null bytes as \000> and
+ escape> converts zero bytes and high-bit-set bytes to
+ octal sequences (\>nnn>) and
doubles backslashes.
encode(E'123\\000\\001', 'base64')
@@ -3234,12 +3235,12 @@ SELECT format('Testing %3$s, %2$s, %s', 'one', 'two', 'three');
decode
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
@@ -3250,13 +3251,16 @@ SELECT format('Testing %3$s, %2$s, %s', 'one', 'two', 'three');
encode
- 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