doc: improve description of subscripting of arrays
authorBruce Momjian <bruce@momjian.us>
Mon, 31 Aug 2020 17:49:17 +0000 (13:49 -0400)
committerBruce Momjian <bruce@momjian.us>
Mon, 31 Aug 2020 17:49:17 +0000 (13:49 -0400)
It wasn't clear the non-integers are cast to integers for subscripting,
rather than throwing an error.

Reported-by: sean@materialize.io
Discussion: https://postgr.es/m/159538675800.624.7728794628229799531@wrigleys.postgresql.org

Backpatch-through: 9.5

doc/src/sgml/syntax.sgml

index 0ee303cb87f381db2a51bb96857bde04ce02d641..b0ae5d2e127e13f3cbdc0337df2b7b43f71d1c59 100644 (file)
@@ -1359,7 +1359,7 @@ CREATE FUNCTION dept(text) RETURNS dept
 </synopsis>
     (Here, the brackets <literal>[ ]</literal> are meant to appear literally.)
     Each <replaceable>subscript</replaceable> is itself an expression,
-    which must yield an integer value.
+    which will be rounded to the nearest integer value.
    </para>
 
    <para>