Arrays: missing/skipped elements

Поиск
Список
Период
Сортировка
Искать
От
Steve Crawford
Тема
Arrays: missing/skipped elements
Дата
Msg-id
20021202191314.42E5E103C7@polaris.pinpointresearch.com
Список
Дерево обсуждения
Arrays: missing/skipped elements Steve Crawford <scrawford@pinpointresearch.com>
Re: Arrays: missing/skipped elements Tom Lane <tgl@sss.pgh.pa.us>
I know from the docs that array elements can't have a null value. It appears, 
therefore, that Postgres fills in missing elements with zero-length strings, 
the int or numeric value zero, etc. appropriate to the data type. Is my 
interpretation correct and is this documented/likely to continue in future 
versions?

My test (extraneous lines removed):

create table foo (bar text[]);
insert into foo values ('{"a","b","c"}');
insert into foo values ('{,,,"4"}');

select * from foo;
 {a,b,c}
 {"","","",4}

select '-' || bar[1] || '-' from foo;
 -a-
 --

select count(*) from foo where bar[1] = '';
     1

Cheers,
Steve
В списке pgsql-general по дате отправления
От: Nicolai Tufar
Дата:
Сообщение: Re: timing queries?
От: Hunter Hillegas
Дата:
Сообщение: 7.3 on OS X HOWTO
FAQ