From: PG Doc comments form <noreply@postgresql.org>
To: pgsql-docs@lists.postgresql.org
Cc: oleg.rekin@gmail.com
Subject: Array functions, array_length behavior given an empty array
Date: Mon, 08 Nov 2021 11:01:51 +0000
Message-ID: <163636931138.8076.5140809232053731248@wrigleys.postgresql.org> (raw)
The following documentation comment has been logged on the website:
Page: https://www.postgresql.org/docs/13/functions-array.html
Description:
For whom it may concern,
I'd like to propose an extension for `array_length` function description.
Currently, it does not cover the case of an empty array:
https://www.postgresql.org/docs/13/functions-array.html
Table 9.52. Array Functions. Row 5
The description reads as `Returns the length of the requested array
dimension.`
For me, an expected result for an empty array would be `0`, but it is
`NULL`.
Tested on `PostgreSQL 13.4` with query `SELECT
ARRAY_LENGTH(ARRAY[]::CHARACTER VARYING[],1);`
I believe, such case deserves to be mentioned in the description and/or in
examples.
With best regards,
Oleg Rekin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-docs@postgresql.org
Cc: noreply@postgresql.org, pgsql-docs@lists.postgresql.org, oleg.rekin@gmail.com
Subject: Re: Array functions, array_length behavior given an empty array
In-Reply-To: <163636931138.8076.5140809232053731248@wrigleys.postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox