aboutsummaryrefslogtreecommitdiff
path: root/doc/src
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>2001-09-04 03:17:54 +0000
committerBruce Momjian <bruce@momjian.us>2001-09-04 03:17:54 +0000
commit9b775726629fe804af71a72c914933025ee21f75 (patch)
tree57cc4f87cb22d1da7378479bfdd035a58a5ec6b9 /doc/src
parentb553cba15a0ffb969e3025e6c65e01bb6971ddd6 (diff)
downloadpostgresql-9b775726629fe804af71a72c914933025ee21f75.tar.gz
postgresql-9b775726629fe804af71a72c914933025ee21f75.zip
Add mention of bytea data type and escaping rules.
Diffstat (limited to 'doc/src')
-rw-r--r--doc/src/sgml/datatype.sgml27
1 files changed, 25 insertions, 2 deletions
diff --git a/doc/src/sgml/datatype.sgml b/doc/src/sgml/datatype.sgml
index ce9fffa0c27..7efc0a75893 100644
--- a/doc/src/sgml/datatype.sgml
+++ b/doc/src/sgml/datatype.sgml
@@ -1,5 +1,5 @@
<!--
-$Header: /cvsroot/pgsql/doc/src/sgml/datatype.sgml,v 1.60 2001/08/31 01:55:25 ishii Exp $
+$Header: /cvsroot/pgsql/doc/src/sgml/datatype.sgml,v 1.61 2001/09/04 03:17:54 momjian Exp $
-->
<chapter id="datatype">
@@ -84,6 +84,12 @@ $Header: /cvsroot/pgsql/doc/src/sgml/datatype.sgml,v 1.60 2001/08/31 01:55:25 is
</row>
<row>
+ <entry><type>bytea</type></entry>
+ <entry></entry>
+ <entry>binary data</entry>
+ </row>
+
+ <row>
<entry><type>character(<replaceable>n</replaceable>)</type></entry>
<entry><type>char(<replaceable>n</replaceable>)</type></entry>
<entry>fixed-length character string</entry>
@@ -782,7 +788,11 @@ CREATE TABLE <replaceable class="parameter">tablename</replaceable> (<replaceabl
<entry>text</entry>
<entry>Variable unlimited length</entry>
</row>
- </tbody>
+ <row>
+ <entry>bytea</entry>
+ <entry>binary data</entry>
+ </row>
+ </tbody>
</tgroup>
</table>
@@ -830,6 +840,19 @@ CREATE TABLE <replaceable class="parameter">tablename</replaceable> (<replaceabl
</para>
<para>
+ The <type>bytea</type> data type allows storage of binary data,
+ specifically allowing storage of NULLs which are entered as
+ <literal>'\\000'</>. The first backslash is interpreted by the
+ single quotes, and the second is recognized by <type>bytea</> and
+ preceeds a three digit octal value. For a similar reason, a
+ backslash must be entered into a field as <literal>'\\\\'</> or
+ <literal>'\\134'</>. You may also have to escape line feeds and
+ carriage return if your interface automatically translates these. It
+ can store values of any length. <type>Bytea</> is a non-standard
+ data type.
+ </para>
+
+ <para>
The storage requirement for data of these types is 4 bytes plus
the actual string, and in case of <type>character</type> plus the
padding. Long strings will actually be compressed by the system