Re: NULL in arrays

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: NULL in arrays
Дата
Msg-id 22226.1074180592@sss.pgh.pa.us
обсуждение исходный текст
Ответ на NULL in arrays  (Dennis Bjorklund <db@zigo.dhs.org>)
Ответы Re: NULL in arrays
Re: NULL in arrays
Список pgsql-bugs
Dennis Bjorklund <db@zigo.dhs.org> writes:
> dennis=# INSERT INTO foo VALUES (ARRAY[2,NULL]);
> INSERT 25353 1

> That last insert contains a NULL value which are not allowed in arrays and
> yet a insert is performed. The table contains a NULL value afterwards
> (and no array).

As we used to say at HP, this is not a bug, it's a definition
disagreement.  You need to give a coherent argument why we should
change, not just claim it's wrong.

Given the present lack of support for null elements in arrays, it's
impossible to have any really pleasant behavior in cases like this.
But I don't see an inherent reason why "raise an error" is better than
"return a null array".

I think Joe Conway is planning to tackle that underlying misfeature
for 7.5.  Whenever it happens, it will result in a number of behavioral
changes for arrays.  I'm not eager to move the definition around in the
meantime, especially not in dot-releases.

            regards, tom lane

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

Предыдущее
От: Dennis Bjorklund
Дата:
Сообщение: Re: NULL in arrays
Следующее
От: Richard Huxton
Дата:
Сообщение: Re: BUG #1049: Invalid SQL Executed as JDBC Prepared Statement still executes embedded SQL