Re: Empty arrays vs. NULLs, 9.1 & 8.3

Поиск
Список
Период
Сортировка
От Steve Crawford
Тема Re: Empty arrays vs. NULLs, 9.1 & 8.3
Дата
Msg-id 4FDA78FA.5000907@pinpointresearch.com
обсуждение исходный текст
Ответ на Re: Empty arrays vs. NULLs, 9.1 & 8.3  (Ken Tanzer <ken.tanzer@gmail.com>)
Список pgsql-general
On 06/14/2012 03:54 PM, Ken Tanzer wrote:
> Thanks Steve.  FWIW I looked at the 9.0 and 9.1 release notes, and
> didn't find much on arrays in them.
The notes are terse (a 1-2 line comment encapsulates the results of
hundreds of messages covering a couple year) but there are many
references to updates in how arrays are handled.
>
> I do have one follow-up curiosity question, though.  Why does
> array_dims(array[]::varchar[]) return NULL instead of 0?  I would
> expect NULL for a NULL array, but not an empty one.  (And the same for
> array_[upper,lower,length] functions as well.
I can't answer, specifically. But it makes a certain amount of sense. An
empty array has no elements so where does it "begin" or "end" -
especially since PostgreSQL array indexes don't need to start at 1 and
the array could be multi-dimensional. Unknown, aka null, seems the best
response.

Cheers,
Steve


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

Предыдущее
От: Ken Tanzer
Дата:
Сообщение: Re: Empty arrays vs. NULLs, 9.1 & 8.3
Следующее
От: xytianer
Дата:
Сообщение: pg_ctl start close the cmd.exe then the server would stop.