Null value representation in the array data structure

From: "Paul Laub" <plaub(at)incyte(dot)com>
To: <pgsql-general(at)postgresql(dot)org>
Subject: Null value representation in the array data structure
Date: 2001-11-06 17:15:08
Message-ID: 00be01c166e6$95f0c4e0$ec02520a@incyte.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)incyte(dot)com
*** Incite genomics! ***

Attachment Content-Type Size
Paul B Laub.vcf text/x-vcard 205 bytes

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Stephan Szabo 2001-11-06 17:22:07 Re: self outer join
Previous Message Mark Nickel 2001-11-06 17:08:15 Re: copy command with PSQL