15061506 <entry>
15071507 Encode binary data into a textual representation. Supported
15081508 formats are: <literal>base64</>, <literal>hex</>, <literal>escape</>.
1509- <literal>escape</> merely outputs null bytes as <literal>\000</> and
1509+ <literal>escape</> converts zero bytes and high-bit-set bytes to
1510+ octal sequences (<literal>\</><replaceable>nnn</>) and
15101511 doubles backslashes.
15111512 </entry>
15121513 <entry><literal>encode(E'123\\000\\001', 'base64')</literal></entry>
@@ -3234,12 +3235,12 @@ SELECT format('Testing %3$s, %2$s, %s', 'one', 'two', 'three');
32343235 <primary>decode</primary>
32353236 </indexterm>
32363237 <literal><function>decode(<parameter>string</parameter> <type>text</type>,
3237- <parameter>type </parameter> <type>text</type>)</function></literal>
3238+ <parameter>format </parameter> <type>text</type>)</function></literal>
32383239 </entry>
32393240 <entry><type>bytea</type></entry>
32403241 <entry>
3241- Decode binarystring from <parameter>string</parameter> previously
3242- encoded with <function>encode </>. Parameter type is same as in <function>encode</>.
3242+ Decode binarydata fromtextual representation in <parameter>string</>.
3243+ Options for <parameter>format </> are same as in <function>encode</>.
32433244 </entry>
32443245 <entry><literal>decode(E'123\\000456', 'escape')</literal></entry>
32453246 <entry><literal>123\000456</literal></entry>
@@ -3250,13 +3251,16 @@ SELECT format('Testing %3$s, %2$s, %s', 'one', 'two', 'three');
32503251 <indexterm>
32513252 <primary>encode</primary>
32523253 </indexterm>
3253- <literal><function>encode(<parameter>string </parameter> <type>bytea</type>,
3254- <parameter>type </parameter> <type>text</type>)</function></literal>
3254+ <literal><function>encode(<parameter>data </parameter> <type>bytea</type>,
3255+ <parameter>format </parameter> <type>text</type>)</function></literal>
32553256 </entry>
32563257 <entry><type>text</type></entry>
32573258 <entry>
3258- Encode binary string to <acronym>ASCII</acronym>-only representation. Supported
3259- types are: <literal>base64</>, <literal>hex</>, <literal>escape</>.
3259+ Encode binary data into a textual representation. Supported
3260+ formats are: <literal>base64</>, <literal>hex</>, <literal>escape</>.
3261+ <literal>escape</> converts zero bytes and high-bit-set bytes to
3262+ octal sequences (<literal>\</><replaceable>nnn</>) and
3263+ doubles backslashes.
32603264 </entry>
32613265 <entry><literal>encode(E'123\\000456'::bytea, 'escape')</literal></entry>
32623266 <entry><literal>123\000456</literal></entry>