Null value representation in the array data structure

Поиск
Список
Период
Сортировка
От Paul Laub
Тема Null value representation in the array data structure
Дата
Msg-id 00be01c166e6$95f0c4e0$ec02520a@incyte.com
обсуждение исходный текст
Ответы Re: Null value representation in the array data structure  (Tom Lane <tgl@sss.pgh.pa.us>)
Список 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! ***


Вложения

В списке pgsql-general по дате отправления:

Предыдущее
От: Fernando Nasser
Дата:
Сообщение: Re: functions, shell script
Следующее
От: Stephan Szabo
Дата:
Сообщение: Re: self outer join