array_ndims never returns zero

Поиск
Список
Период
Сортировка
От Vladimir Svedov
Тема array_ndims never returns zero
Дата
Msg-id CADqDLE-+FtA1hHwSk-Y3vfjVfen-z9uYftiLHRFifvWEtV1VGg@mail.gmail.com
обсуждение исходный текст
Ответы Re: array_ndims never returns zero  (Tom Lane <tgl@sss.pgh.pa.us>)
Список 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 по дате отправления:

Предыдущее
От: Marco Nenciarini
Дата:
Сообщение: [PATCH] Logical decoding of TRUNCATE
Следующее
От: John Naylor
Дата:
Сообщение: Re: MCV lists for highly skewed distributions