mirror of
https://github.com/postgres/postgres.git
synced 2025-10-24 01:29:19 +03:00
Document encode(bytea, 'escape')'s behavior correctly.
I changed this in commit fd15dba543, but
missed the fact that the SGML documentation of the function specified
exactly what it did. Well, one of the two places where it's specified
documented that --- probably I looked at the other place and thought
nothing needed to be done. Sync the two places where encode() and
decode() are described.
This commit is contained in:
@@ -1505,7 +1505,8 @@
|
|||||||
<entry>
|
<entry>
|
||||||
Encode binary data into a textual representation. Supported
|
Encode binary data into a textual representation. Supported
|
||||||
formats are: <literal>base64</>, <literal>hex</>, <literal>escape</>.
|
formats are: <literal>base64</>, <literal>hex</>, <literal>escape</>.
|
||||||
<literal>escape</> merely outputs null bytes as <literal>\000</> and
|
<literal>escape</> converts zero bytes and high-bit-set bytes to
|
||||||
|
octal sequences (<literal>\</><replaceable>nnn</>) and
|
||||||
doubles backslashes.
|
doubles backslashes.
|
||||||
</entry>
|
</entry>
|
||||||
<entry><literal>encode(E'123\\000\\001', 'base64')</literal></entry>
|
<entry><literal>encode(E'123\\000\\001', 'base64')</literal></entry>
|
||||||
@@ -3020,12 +3021,12 @@
|
|||||||
<primary>decode</primary>
|
<primary>decode</primary>
|
||||||
</indexterm>
|
</indexterm>
|
||||||
<literal><function>decode(<parameter>string</parameter> <type>text</type>,
|
<literal><function>decode(<parameter>string</parameter> <type>text</type>,
|
||||||
<parameter>type</parameter> <type>text</type>)</function></literal>
|
<parameter>format</parameter> <type>text</type>)</function></literal>
|
||||||
</entry>
|
</entry>
|
||||||
<entry><type>bytea</type></entry>
|
<entry><type>bytea</type></entry>
|
||||||
<entry>
|
<entry>
|
||||||
Decode binary string from <parameter>string</parameter> previously
|
Decode binary data from textual representation in <parameter>string</>.
|
||||||
encoded with <function>encode</>. Parameter type is same as in <function>encode</>.
|
Options for <parameter>format</> are same as in <function>encode</>.
|
||||||
</entry>
|
</entry>
|
||||||
<entry><literal>decode(E'123\\000456', 'escape')</literal></entry>
|
<entry><literal>decode(E'123\\000456', 'escape')</literal></entry>
|
||||||
<entry><literal>123\000456</literal></entry>
|
<entry><literal>123\000456</literal></entry>
|
||||||
@@ -3036,13 +3037,16 @@
|
|||||||
<indexterm>
|
<indexterm>
|
||||||
<primary>encode</primary>
|
<primary>encode</primary>
|
||||||
</indexterm>
|
</indexterm>
|
||||||
<literal><function>encode(<parameter>string</parameter> <type>bytea</type>,
|
<literal><function>encode(<parameter>data</parameter> <type>bytea</type>,
|
||||||
<parameter>type</parameter> <type>text</type>)</function></literal>
|
<parameter>format</parameter> <type>text</type>)</function></literal>
|
||||||
</entry>
|
</entry>
|
||||||
<entry><type>text</type></entry>
|
<entry><type>text</type></entry>
|
||||||
<entry>
|
<entry>
|
||||||
Encode binary string to <acronym>ASCII</acronym>-only representation. Supported
|
Encode binary data into a textual representation. Supported
|
||||||
types are: <literal>base64</>, <literal>hex</>, <literal>escape</>.
|
formats are: <literal>base64</>, <literal>hex</>, <literal>escape</>.
|
||||||
|
<literal>escape</> converts zero bytes and high-bit-set bytes to
|
||||||
|
octal sequences (<literal>\</><replaceable>nnn</>) and
|
||||||
|
doubles backslashes.
|
||||||
</entry>
|
</entry>
|
||||||
<entry><literal>encode(E'123\\000456'::bytea, 'escape')</literal></entry>
|
<entry><literal>encode(E'123\\000456'::bytea, 'escape')</literal></entry>
|
||||||
<entry><literal>123\000456</literal></entry>
|
<entry><literal>123\000456</literal></entry>
|
||||||
|
|||||||
Reference in New Issue
Block a user