|
1447 | 1447 | <entry>
|
1448 | 1448 | Encode binary data into a textual representation. Supported
|
1449 | 1449 | formats are: <literal>base64</>, <literal>hex</>, <literal>escape</>.
|
1450 |
| - <literal>escape</> merely outputs null bytes as <literal>\000</> and |
| 1450 | + <literal>escape</> converts zero bytes and high-bit-set bytes to |
| 1451 | + octal sequences (<literal>\</><replaceable>nnn</>) and |
1451 | 1452 | doubles backslashes.
|
1452 | 1453 | </entry>
|
1453 | 1454 | <entry><literal>encode(E'123\\000\\001', 'base64')</literal></entry>
|
|
2753 | 2754 | <row>
|
2754 | 2755 | <entry>
|
2755 | 2756 | <literal><function>decode(<parameter>string</parameter> <type>text</type>,
|
2756 |
| - <parameter>type</parameter> <type>text</type>)</function></literal> |
| 2757 | + <parameter>format</parameter> <type>text</type>)</function></literal> |
2757 | 2758 | </entry>
|
2758 | 2759 | <entry><type>bytea</type></entry>
|
2759 | 2760 | <entry>
|
2760 |
| - Decode binary string from <parameter>string</parameter> previously |
2761 |
| - encoded with <function>encode</>. Parameter type is same as in <function>encode</>. |
| 2761 | + Decode binary data from textual representation in <parameter>string</>. |
| 2762 | + Options for <parameter>format</> are same as in <function>encode</>. |
2762 | 2763 | </entry>
|
2763 | 2764 | <entry><literal>decode(E'123\\000456', 'escape')</literal></entry>
|
2764 | 2765 | <entry><literal>123\000456</literal></entry>
|
2765 | 2766 | </row>
|
2766 | 2767 |
|
2767 | 2768 | <row>
|
2768 | 2769 | <entry>
|
2769 |
| - <literal><function>encode(<parameter>string</parameter> <type>bytea</type>, |
2770 |
| - <parameter>type</parameter> <type>text</type>)</function></literal> |
| 2770 | + <literal><function>encode(<parameter>data</parameter> <type>bytea</type>, |
| 2771 | + <parameter>format</parameter> <type>text</type>)</function></literal> |
2771 | 2772 | </entry>
|
2772 | 2773 | <entry><type>text</type></entry>
|
2773 | 2774 | <entry>
|
2774 |
| - Encode binary string to <acronym>ASCII</acronym>-only representation. Supported |
2775 |
| - types are: <literal>base64</>, <literal>hex</>, <literal>escape</>. |
| 2775 | + Encode binary data into a textual representation. Supported |
| 2776 | + formats are: <literal>base64</>, <literal>hex</>, <literal>escape</>. |
| 2777 | + <literal>escape</> converts zero bytes and high-bit-set bytes to |
| 2778 | + octal sequences (<literal>\</><replaceable>nnn</>) and |
| 2779 | + doubles backslashes. |
2776 | 2780 | </entry>
|
2777 | 2781 | <entry><literal>encode(E'123\\000456'::bytea, 'escape')</literal></entry>
|
2778 | 2782 | <entry><literal>123\000456</literal></entry>
|
|
0 commit comments