doc: array_length produces null instead of 0

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема doc: array_length produces null instead of 0
Дата
Msg-id CAKFQuwaoBmRuWdMLzLHDCFDJDX3wvfQ7egAF0bpik_BFgG1KWg@mail.gmail.com
обсуждение исходный текст
Ответы Re: doc: array_length produces null instead of 0  (Aleksander Alekseev <aleksander@timescale.com>)
Список pgsql-hackers
Hi,

Per discussion here:


We can now easily document the array_length behavior of returning null instead of zero for an empty array/dimension.

I added an example to the json_array_length function to demonstrate that it does return 0 as one would expect, but contrary to the SQL array behavior.

I did not bother to add examples to the other half dozen or so "_length" functions that all produce 0 as expected.  Just the surprising case and the adjacent one.

David J.

Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Thomas Munro
Дата:
Сообщение: Re: Collation version tracking for macOS
Следующее
От: Peter Geoghegan
Дата:
Сообщение: Re: Collation version tracking for macOS