Re: [PATCH] Exorcise "zero-dimensional" arrays (Was: Re: Should array_length() Return NULL)

Поиск
Список
Период
Сортировка
От Darren Duncan
Тема Re: [PATCH] Exorcise "zero-dimensional" arrays (Was: Re: Should array_length() Return NULL)
Дата
Msg-id 51B929F9.9040909@darrenduncan.net
обсуждение исходный текст
Ответ на Re: [PATCH] Exorcise "zero-dimensional" arrays (Was: Re: Should array_length() Return NULL)  (Josh Berkus <josh@agliodbs.com>)
Список pgsql-hackers
On 2013.06.12 10:11 AM, Josh Berkus wrote:
>>> Multidim arrays are why we can't have nice things.
>>
>> Yeah, I think that was not our best moment.  :-(
>
> Actually, if you think about it, we've never had "arrays" in PostgreSQL
> ... we have always had matrixes.  If you think about things that way,
> most of the current functionality makes sense.

If the type system were changed so that arrays were were always just 
one-dimensional, you can define your matrix simply as a binary relation type 
whose primary key attribute has the type of a fixed-length array of integers, 
where the number of elements in the array is the number of dimensions in the 
matrix, and the array elements themselves defined the coordinates in the matrix.  This design confers a number of
benefits. Also, the case of the 
 
zero-dimension matrix needs no special treatment; the key array has zero 
elements.  Would that not work? -- Darren Duncan




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

Предыдущее
От: Stephen Frost
Дата:
Сообщение: Re: Parallell Optimizer
Следующее
От: Tom Dunstan
Дата:
Сообщение: Re: Patch to add support of "IF NOT EXISTS" to others "CREATE" statements