array_ndims never returns zero - Mailing list pgsql-hackers

From Vladimir Svedov
Subject array_ndims never returns zero
Date
Msg-id CADqDLE-+FtA1hHwSk-Y3vfjVfen-z9uYftiLHRFifvWEtV1VGg@mail.gmail.com
Whole thread Raw
Responses Re: array_ndims never returns zero
List pgsql-hackers
Hi,
Reading https://stackoverflow.com/questions/48022753/why-does-array-ndimsarray-produce-null#48022980 confused me much - why array_ndims never returns zero indeed?..
select char_length('') returns zero and according to https://www.postgresql.org/docs/current/static/functions-string.html it shows the "Number of characters in string ",on the other hand https://www.postgresql.org/docs/10/static/functions-array.html array_ndims "returns the number of dimensions of the array",but https://github.com/postgres/postgres/blob/master/src/backend/utils/adt/arrayfuncs.c#L1635 
if (AARR_NDIM(v) <= 0 || AARR_NDIM(v) > MAXDIM)
PG_RETURN_NULL();
so the question - do you think it makes sense?.. What is the logic behind it?
Please advise where to address it if I chose the wrong channel, as It's probably not a bug, but a feature?..

Regards

pgsql-hackers by date:

Previous
From: Marco Nenciarini
Date:
Subject: [PATCH] Logical decoding of TRUNCATE
Next
From: John Naylor
Date:
Subject: Re: MCV lists for highly skewed distributions