Null value representation in the array data structure - Mailing list pgsql-general

From Paul Laub
Subject Null value representation in the array data structure
Date
Msg-id 00be01c166e6$95f0c4e0$ec02520a@incyte.com
Whole thread Raw
Responses Re: Null value representation in the array data structure
List pgsql-general
Dear all,

I'd like to store arrays of numerical data as a column
of data. Everything works fine in PostgreSQL 7.1.3
except for one thing: there seems to be no way of
representing NULL numerical data. For example, using
the following table

    create table arraydata (rowid text primary key, data float4[]);

the statement

    insert into arraydata values ( 'rowname', '{100,NULL,300}' );

returns "ERROR:  Bad float4 input format 'NULL'" while

    insert into arraydata values ( 'rowname', '{100,,300}' );

successfully inserts but inserts '{100, 0, 300}'.
Because 0 is for me a legitimate data value, one not to
be confused with NULL, this does not work for me
either.

QUESTIONS:

1. Is there a way of representing NULL numerical data
in arrays I have overlooked?

2. If not, are there workarounds more attractive than
using a numerical flag value (e.g., -9999)? (That
reminds me of FORTRAN 77 days long ago!)

Paul Laub




Paul B. Laub      http://astatine.incyte.com/laub      (650) 845-5411 (voice)
Incyte Genomics, Inc.   3160 Porter Dr.  Palo Alto, CA 94304 plaub@incyte.com
                       *** Incite genomics! ***


Attachment

pgsql-general by date:

Previous
From: Fernando Nasser
Date:
Subject: Re: functions, shell script
Next
From: Stephan Szabo
Date:
Subject: Re: self outer join