About the behavior of array_length() for empty array
| От | iihero |
|---|---|
| Тема | About the behavior of array_length() for empty array |
| Дата | |
| Msg-id | tencent_5D502954744B7F744ED6F34E@qq.com обсуждение исходный текст |
| Ответы |
Re: About the behavior of array_length() for empty array
|
| Список | pgsql-hackers |
postgres=# select '{}'::integer[] = array[[]]::integer[][];
?column?
----------
t
postgres=# select '{}'::integer[] = array[[[]]]::integer[][][];
?column?
----------
t
From this point of view, seems N dimensions of empty array all are equivalent.
But the result of array_length of them always are null.
postgres=# select array_length('{}'::integer[],0);
array_length
--------------
postgres=# select array_length(array[[[]]]::integer[][][],0);
array_length
--------------
postgres=# select array_length(array[[[]]]::integer[][][],3) is null;
?column?
----------
t
I just think any "empty" array length should return 0, but not null. It's not a NULL array.
Is there standard definition of this behavior?
Is there standard definition of this behavior?
------------------
----------------------------------------------------------
iihero(Xiong He) http://www.sql9.com
----------------------------------------------------------
В списке pgsql-hackers по дате отправления: