Re: Inconsistent behavior on Array & Is Null?

Поиск
Список
Период
Сортировка
От Joe Conway
Тема Re: Inconsistent behavior on Array & Is Null?
Дата
Msg-id 406D9A92.1020107@joeconway.com
обсуждение исходный текст
Ответ на Re: Inconsistent behavior on Array & Is Null?  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Tom Lane wrote:
> I think that maybe we ought to question these two properties:
>     * empty array is different from NULL ... really?  Why?

I think this makes sense, similar to the difference between '' and NULL.

>     * storing a value into an element of a NULL array yields
>       a NULL array instead of a singleton array.

Same argument. If you think of text as an array or characters, you get 
this analogy (sort of):

regression=# create table s1(f1 int, f2 text);
CREATE TABLE
regression=# insert into s1 values(1, null);
INSERT 164679 1

regression=# select f1, substr(f2, 1, 1) is null from s1; f1 | ?column?
----+----------  1 | t
(1 row)

regression=# update s1 set f2 = 'a' || substr(f2, 2);
UPDATE 1
regression=# select f1, substr(f2, 1, 1) is null from s1; f1 | ?column?
----+----------  1 | t
(1 row)

Joe



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

Предыдущее
От: Joe Conway
Дата:
Сообщение: Re: Inconsistent behavior on Array & Is Null?
Следующее
От: jseymour@LinxNet.com (Jim Seymour)
Дата:
Сообщение: Re: Problems Vacuum'ing