diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2013-03-28 23:14:54 -0400 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2013-03-28 23:14:54 -0400 |
commit | 9ad27c215362df436f8c16f1aace923011f31be4 (patch) | |
tree | c43d9a30698f5715698f4affcb966677705eacd3 /doc/src | |
parent | aa02864f64c46807f7682a41882fe40f7f5cb819 (diff) | |
download | postgresql-9ad27c215362df436f8c16f1aace923011f31be4.tar.gz postgresql-9ad27c215362df436f8c16f1aace923011f31be4.zip |
Document encode(bytea, 'escape')'s behavior correctly.
I changed this in commit fd15dba543247eb1ce879d22632b9fdb4c230831, 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.
Diffstat (limited to 'doc/src')
-rw-r--r-- | doc/src/sgml/func.sgml | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml index db4e33f871d..a0ecc4f5685 100644 --- a/doc/src/sgml/func.sgml +++ b/doc/src/sgml/func.sgml @@ -1506,7 +1506,8 @@ <entry> Encode binary data into a textual representation. Supported 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. </entry> <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'); <primary>decode</primary> </indexterm> <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><type>bytea</type></entry> <entry> - Decode binary string from <parameter>string</parameter> previously - encoded with <function>encode</>. Parameter type is same as in <function>encode</>. + Decode binary data from textual representation in <parameter>string</>. + Options for <parameter>format</> are same as in <function>encode</>. </entry> <entry><literal>decode(E'123\\000456', 'escape')</literal></entry> <entry><literal>123\000456</literal></entry> @@ -3250,13 +3251,16 @@ SELECT format('Testing %3$s, %2$s, %s', 'one', 'two', 'three'); <indexterm> <primary>encode</primary> </indexterm> - <literal><function>encode(<parameter>string</parameter> <type>bytea</type>, - <parameter>type</parameter> <type>text</type>)</function></literal> + <literal><function>encode(<parameter>data</parameter> <type>bytea</type>, + <parameter>format</parameter> <type>text</type>)</function></literal> </entry> <entry><type>text</type></entry> <entry> - Encode binary string to <acronym>ASCII</acronym>-only representation. Supported - types are: <literal>base64</>, <literal>hex</>, <literal>escape</>. + Encode binary data into a textual representation. Supported + 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><literal>encode(E'123\\000456'::bytea, 'escape')</literal></entry> <entry><literal>123\000456</literal></entry> |