Обсуждение: Null as array element

Поиск
Список
Период
Сортировка

Null as array element

От
Amin Abdulghani
Дата:
Hi,

I have recently been playing around with the array data types. My
objective is to use Postgress to store sparse arrays.
  One of the things that I noticed is that I can't store null as a value
for an element of an array. So for example if I have a column A of type
text[] and  the values for this column are set to {"val1",null,"val2",,"val3"},
then I would have A[1]="val1", A[2]="null", A[3]="val2", A4="" (empty string),
A[5]="val3". What I am guessing from this  is that each element is
actually taking up space. I am wondering whether there is a better way
to approach this to store sparse arrays.

Thanks..
Amin