|
1505 | 1505 | <entry>
|
1506 | 1506 | Encode binary data into a textual representation. Supported
|
1507 | 1507 | formats are: <literal>base64</>, <literal>hex</>, <literal>escape</>.
|
1508 |
| - <literal>escape</> merely outputs null bytes as <literal>\000</> and |
| 1508 | + <literal>escape</> converts zero bytes and high-bit-set bytes to |
| 1509 | + octal sequences (<literal>\</><replaceable>nnn</>) and |
1509 | 1510 | doubles backslashes.
|
1510 | 1511 | </entry>
|
1511 | 1512 | <entry><literal>encode(E'123\\000\\001', 'base64')</literal></entry>
|
|
3020 | 3021 | <primary>decode</primary>
|
3021 | 3022 | </indexterm>
|
3022 | 3023 | <literal><function>decode(<parameter>string</parameter> <type>text</type>,
|
3023 |
| - <parameter>type</parameter> <type>text</type>)</function></literal> |
| 3024 | + <parameter>format</parameter> <type>text</type>)</function></literal> |
3024 | 3025 | </entry>
|
3025 | 3026 | <entry><type>bytea</type></entry>
|
3026 | 3027 | <entry>
|
3027 |
| - Decode binary string from <parameter>string</parameter> previously |
3028 |
| - encoded with <function>encode</>. Parameter type is same as in <function>encode</>. |
| 3028 | + Decode binary data from textual representation in <parameter>string</>. |
| 3029 | + Options for <parameter>format</> are same as in <function>encode</>. |
3029 | 3030 | </entry>
|
3030 | 3031 | <entry><literal>decode(E'123\\000456', 'escape')</literal></entry>
|
3031 | 3032 | <entry><literal>123\000456</literal></entry>
|
|
3036 | 3037 | <indexterm>
|
3037 | 3038 | <primary>encode</primary>
|
3038 | 3039 | </indexterm>
|
3039 |
| - <literal><function>encode(<parameter>string</parameter> <type>bytea</type>, |
3040 |
| - <parameter>type</parameter> <type>text</type>)</function></literal> |
| 3040 | + <literal><function>encode(<parameter>data</parameter> <type>bytea</type>, |
| 3041 | + <parameter>format</parameter> <type>text</type>)</function></literal> |
3041 | 3042 | </entry>
|
3042 | 3043 | <entry><type>text</type></entry>
|
3043 | 3044 | <entry>
|
3044 |
| - Encode binary string to <acronym>ASCII</acronym>-only representation. Supported |
3045 |
| - types are: <literal>base64</>, <literal>hex</>, <literal>escape</>. |
| 3045 | + Encode binary data into a textual representation. Supported |
| 3046 | + formats are: <literal>base64</>, <literal>hex</>, <literal>escape</>. |
| 3047 | + <literal>escape</> converts zero bytes and high-bit-set bytes to |
| 3048 | + octal sequences (<literal>\</><replaceable>nnn</>) and |
| 3049 | + doubles backslashes. |
3046 | 3050 | </entry>
|
3047 | 3051 | <entry><literal>encode(E'123\\000456'::bytea, 'escape')</literal></entry>
|
3048 | 3052 | <entry><literal>123\000456</literal></entry>
|
|
0 commit comments