1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-28 23:42:10 +03:00

> > Put encode() into base system. Used part of Alex' patch

> > for docs, hope he does not mind ;)

Marko Kreen
This commit is contained in:
Bruce Momjian
2001-07-11 22:14:03 +00:00
parent 4051bce27d
commit 7771436e18
4 changed files with 40 additions and 5 deletions

View File

@ -1,4 +1,4 @@
<!-- $Header: /cvsroot/pgsql/doc/src/sgml/func.sgml,v 1.63 2001/07/03 02:42:18 momjian Exp $ -->
<!-- $Header: /cvsroot/pgsql/doc/src/sgml/func.sgml,v 1.64 2001/07/11 22:14:01 momjian Exp $ -->
<chapter id="functions">
<title>Functions and Operators</title>
@ -1051,6 +1051,34 @@
<entry>translate('12345', '14', 'ax')</entry>
<entry>a23x5</entry>
</row>
<row>
<entry>
encode(<parameter>data</parameter> <type>bytea</type>,
<parameter>type</parameter> <type>text</type>)
</entry>
<entry><type>text</type></entry>
<entry>
Encodes binary data to ascii-only representation. Supported
types are: 'base64', 'hex'.
</entry>
<entry>encode('123\\000\\001', 'base64')</entry>
<entry>MTIzAAE=</entry>
</row>
<row>
<entry>
decode(<parameter>string</parameter> <type>text</type>,
<parameter>type</parameter> <type>text</type>)
</entry>
<entry><type>bytea</type></entry>
<entry>
Decodes binary data from <parameter>string</parameter> previously
encoded with encode(). Parameter type is same as in encode().
</entry>
<entry>decode('MTIzAAE=', 'base64')</entry>
<entry>123\000\001</entry>
</row>
</tbody>
</tgroup>