From: Bruce Momjian Date: Tue, 20 Feb 2007 14:34:29 +0000 (+0000) Subject: Update array slice documentation to be clearer. X-Git-Tag: REL8_2_4~47 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0586e9b6825e5c1acbdb0771da74095de518ad28;p=thirdparty%2Fpostgresql.git Update array slice documentation to be clearer. --- diff --git a/doc/src/sgml/array.sgml b/doc/src/sgml/array.sgml index 3908181c923..7c5442004d5 100644 --- a/doc/src/sgml/array.sgml +++ b/doc/src/sgml/array.sgml @@ -1,4 +1,4 @@ - + Arrays @@ -243,18 +243,14 @@ SELECT schedule[1:2][1:1] FROM sal_emp WHERE name = 'Bill'; (1 row) - We could also have written + If any dimmension is written as a slice, i.e contains a colon, then all + dimmensions are treated as slices. If a dimmension is missing, it is + assumed to be [1:1]. If a dimmension has only a single + number (no colon), that dimmension is treated as being from 1 + to the number specified. For example, [2] is treated as + [1:2], as in this example: -SELECT schedule[1:2][1] FROM sal_emp WHERE name = 'Bill'; - - - with the same result. An array subscripting operation is always taken to - represent an array slice if any of the subscripts are written in the form - lower:upper. - A lower bound of 1 is assumed for any subscript where only one value - is specified, as in this example: - SELECT schedule[1:2][2] FROM sal_emp WHERE name = 'Bill'; schedule