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