On Wed, Jul 22, 2020 at 02:59:18AM +0000, PG Doc comments form wrote:
> The following documentation comment has been logged on the website:
>
> Page: https://www.postgresql.org/docs/12/sql-expressions.html
> Description:
>
> Section 4.2.3. Subscripts of the documentation states:
>
> > Each subscript is itself an expression, which must yield an integer
> value.
>
> However, the following query works on Postgres 12.1
>
> SELECT (ARRAY[1, 2, 3]::integer[])[1.5];
>
> array
> -------
> 2
>
> I believe a more appropriate statement would acknowledge that at least some
> values undergo an explicit-style conversion to an integer.
OK, how is the attached patch?
--
Bruce Momjian <[email protected]> https://momjian.us
EnterpriseDB https://enterprisedb.com
The usefulness of a cup is in its emptiness, Bruce Lee
diff --git a/doc/src/sgml/syntax.sgml b/doc/src/sgml/syntax.sgml
index 2f993ca2e0..4930cecd7b 100644
--- a/doc/src/sgml/syntax.sgml
+++ b/doc/src/sgml/syntax.sgml
@@ -1378,7 +1378,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.
+ and will be rounded to an integer value.
</para>
<para>