Array Madness

From: Michael Richards <miker(at)scifair(dot)acadiau(dot)ca>
To: pgsql-sql(at)postgresql(dot)org
Subject: Array Madness
Date: 1999-09-14 01:56:28
Message-ID: Pine.BSF.4.10.9909132250160.63880-100000@scifair.acadiau.ca
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Bruce Momjian 1999-09-14 02:19:48 Re: [SQL] Array Madness
Previous Message Michael Richards 1999-09-14 01:38:16 Re: [SQL] Postgres Table grows very quickly?