-<!-- $PostgreSQL: pgsql/doc/src/sgml/array.sgml,v 1.64 2008/03/26 16:34:47 tgl Exp $ -->
+<!-- $PostgreSQL: pgsql/doc/src/sgml/array.sgml,v 1.65 2008/04/27 04:33:27 alvherre Exp $ -->
<sect1 id="arrays">
<title>Arrays</title>
Arrays of domains are not yet supported.
</para>
- <sect2>
+ <sect2 id="arrays-declaration">
<title>Declaration of Array Types</title>
+ <indexterm>
+ <primary>array</primary>
+ <secondary>declaration</secondary>
+ </indexterm>
+
<para>
To illustrate the use of array types, we create this table:
<programlisting>
</para>
</sect2>
- <sect2>
+ <sect2 id="arrays-input">
<title>Array Value Input</title>
<indexterm>
</para>
</sect2>
- <sect2>
+ <sect2 id="arrays-accessing">
<title>Accessing Arrays</title>
+ <indexterm>
+ <primary>array</primary>
+ <secondary>accessing</secondary>
+ </indexterm>
+
<para>
Now, we can run some queries on the table.
First, we show how to access a single element of an array at a time.
</para>
</sect2>
- <sect2>
+ <sect2 id="arrays-modifying">
<title>Modifying Arrays</title>
+ <indexterm>
+ <primary>array</primary>
+ <secondary>modifying</secondary>
+ </indexterm>
+
<para>
An array value can be replaced completely:
</para>
</sect2>
- <sect2>
+ <sect2 id="arrays-searching">
<title>Searching in Arrays</title>
+ <indexterm>
+ <primary>array</primary>
+ <secondary>searching</secondary>
+ </indexterm>
+
<para>
To search for a value in an array, you must check each value of the
array. This can be done by hand, if you know the size of the array.
</tip>
</sect2>
- <sect2>
+ <sect2 id="arrays-io">
<title>Array Input and Output Syntax</title>
+ <indexterm>
+ <primary>array</primary>
+ <secondary>I/O</secondary>
+ </indexterm>
+
<para>
The external text representation of an array value consists of items that
are interpreted according to the I/O conversion rules for the array's