Inconsistent behavior on Array & Is Null?
| От | Josh Berkus |
|---|---|
| Тема | Inconsistent behavior on Array & Is Null? |
| Дата | |
| Msg-id | 200403301134.15409.josh@agliodbs.com обсуждение исходный текст |
| Ответы |
Re: Inconsistent behavior on Array & Is Null?
|
| Список | pgsql-hackers |
Joe,
First off, pardon me if these are known things which are already fixed in CVS.
Also, let me again thank you for all the work on Arrays in 7.4; I've been
able to tremendously simplify quite a number of procedures in my databases
thanks to the new array support.
Now, the issue:
I'm noticing some inconsistent behavior regarding empty arrays and IS NULL
status. For example:
net_test=# select array_upper('{}'::INT[], 1);array_upper
-------------
(1 row)
net_test=# select array_upper('{}'::INT[], 1) IS NULL;?column?
----------t
(1 row)
net_test=# select '{}'::INT[] IS NULL;?column?
----------f
(1 row)
I feel that this is confusing; an empty array should be considered NULL
everywhere or nowhere. For that matter, the new array declaration syntax
does not support empty arrays:
net_test=# select ARRAY[ ]::INT[];
ERROR: syntax error at or near "]" at character 15
net_test=# select ARRAY[]::INT[];
ERROR: syntax error at or near "]" at character 14
net_test=#
--
-Josh BerkusAglio Database SolutionsSan Francisco
В списке pgsql-hackers по дате отправления: