Improve documentation for odd array slice behavior.
authorBruce Momjian
Wed, 26 Mar 2008 14:43:20 +0000 (14:43 +0000)
committerBruce Momjian
Wed, 26 Mar 2008 14:43:20 +0000 (14:43 +0000)
doc/src/sgml/array.sgml

index b1e0b29310719950006663bbadbe1011069517a0..9b0e658d81aa0303eaf8e6d9eac57821f7a766d0 100644 (file)
@@ -1,4 +1,4 @@
-
+
 
 
  Arrays
@@ -258,6 +258,9 @@ SELECT schedule[1:2][2] FROM sal_emp WHERE name = 'Bill';
  {{meeting,lunch},{training,presentation}}
 (1 row)
 
+
+  To avoid confusion with slices, use slice syntax for all dimmension
+  references, e.g.  [1:2][1:1], not [2][1:1].
  
 
  
@@ -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.