summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruce Momjian2008-03-26 14:43:20 +0000
committerBruce Momjian2008-03-26 14:43:20 +0000
commit7480d85dc90f6bde7efbf30350e1ba064ba5d2f2 (patch)
tree033ff0c2270c7a5204d709199fba6c48529123c3
parent6bf931d43b7241a93f71a925586b5f634e32b1bd (diff)
Improve documentation for odd array slice behavior.
-rw-r--r--doc/src/sgml/array.sgml6
1 files changed, 5 insertions, 1 deletions
diff --git a/doc/src/sgml/array.sgml b/doc/src/sgml/array.sgml
index bf93315ec2..3f7e5d9a3e 100644
--- a/doc/src/sgml/array.sgml
+++ b/doc/src/sgml/array.sgml
@@ -258,6 +258,9 @@ SELECT schedule[1:2][2] FROM sal_emp WHERE name = 'Bill';
{{meeting,lunch},{training,presentation}}
(1 row)
</programlisting>
+
+ To avoid confusion with slices, use slice syntax for all dimmension
+ references, e.g. <literal>[1:2][1:1]</>, not <literal>[2][1:1]</>.
</para>
<para>
@@ -275,7 +278,8 @@ SELECT schedule[1:2][2] FROM sal_emp WHERE name = 'Bill';
any of the subscript expressions are null. However, in other corner
cases such as selecting an array slice that
is completely outside the current array bounds, a slice expression
- yields an empty (zero-dimensional) array instead of null.
+ yields an empty (zero-dimensional) array instead of null. (This
+ does not match non-slice behavior and is done for historical reasons.)
If the requested slice partially overlaps the array bounds, then it
is silently reduced to just the overlapping region.
</para>