Array Madness - Mailing list pgsql-sql

From Michael Richards
Subject Array Madness
Date
Msg-id Pine.BSF.4.10.9909132250160.63880-100000@scifair.acadiau.ca
Whole thread Raw
Responses Re: [SQL] Array Madness  (Bruce Momjian <maillist@candle.pha.pa.us>)
Re: [SQL] Array Madness  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-sql
Hi.
I've started to fiddle with arrays. Every time I fiddle stuff breaks or
won't work for me :)

It seems that you can't have a NULL value in an array. I think based on
the idea of RDBMSes you should be able to have an array value that is
null... Running an update and setting a single array value to null seems
to nuke the entire array.

create table test(features int4[]);
insert into test values ('{NULL,1}');     
ERROR:  pg_atoi: error in "NULL": can't parse "NULL"
insert into test values ('{0,1}');
insert into test values ('{,1}');
select * from test;
features
--------
{0,1}   
{0,1}   
(2 rows)
update test set features[2]=NULL;
UPDATE 2
select * from test;              
features
--------              
(2 rows)

Positively a bad thing...

-Michael



pgsql-sql by date:

Previous
From: Michael Richards
Date:
Subject: Re: [SQL] Postgres Table grows very quickly?
Next
From: Bruce Momjian
Date:
Subject: Re: [SQL] Array Madness