1506
1506
<entry>
1507
1507
Encode binary data into a textual representation. Supported
1508
1508
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
1510
1511
doubles backslashes.
1511
1512
</entry>
1512
1513
<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');
3234
3235
<primary>decode</primary>
3235
3236
</indexterm>
3236
3237
<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>
3238
3239
</entry>
3239
3240
<entry><type>bytea</type></entry>
3240
3241
<entry>
3241
- Decode binary string from <parameter>string</parameter> previously
3242
- encoded with <function>encode </>. Parameter type is same as in <function>encode</>.
3242
+ Decode binary data from textual representation in <parameter>string</>.
3243
+ Options for <parameter>format </> are same as in <function>encode</>.
3243
3244
</entry>
3244
3245
<entry><literal>decode(E'123\\000456', 'escape')</literal></entry>
3245
3246
<entry><literal>123\000456</literal></entry>
@@ -3250,13 +3251,16 @@ SELECT format('Testing %3$s, %2$s, %s', 'one', 'two', 'three');
3250
3251
<indexterm>
3251
3252
<primary>encode</primary>
3252
3253
</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>
3255
3256
</entry>
3256
3257
<entry><type>text</type></entry>
3257
3258
<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.
3260
3264
</entry>
3261
3265
<entry><literal>encode(E'123\\000456'::bytea, 'escape')</literal></entry>
3262
3266
<entry><literal>123\000456</literal></entry>
0 commit comments