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

Поиск
Список
Период
Сортировка
От Dean Rasheed
Тема Re: [PATCH] Exorcise "zero-dimensional" arrays (Was: Re: Should array_length() Return NULL)
Дата
Msg-id CAEZATCVcW1ztFoSsa7ODFd+4GJvfmjUudvC_JO6D1Q-xa+kO5w@mail.gmail.com
обсуждение исходный текст
Ответ на Re: [PATCH] Exorcise "zero-dimensional" arrays (Was: Re: Should array_length() Return NULL)  (Brendan Jurd <direvus@gmail.com>)
Ответы Re: [PATCH] Exorcise "zero-dimensional" arrays (Was: Re: Should array_length() Return NULL)  (Brendan Jurd <direvus@gmail.com>)
Список pgsql-hackers
On 27 March 2013 17:14, Brendan Jurd <direvus@gmail.com> wrote:
> On 28 March 2013 00:21, Dean Rasheed <dean.a.rasheed@gmail.com> wrote:
>> The patch is also allowing '{{},{},{}}' which is described up-thread
>> as a 2-D empty array. That's pretty misleading, since it has length 3
>> (in the first dimension). '{{},{}}' and '{{}}' are both "more empty",
>> but neither is completely empty.
>
>> I'm not saying that the current situation is not broken. I'm just
>> questioning whether the fix is actually any less confusing than what
>> we have now.
>
> Well the fix is primarily about 1-D empty arrays, and in that respect
> it is much less confusing than what we have now.

Maybe. But even in 1-D, it's still jumping from having one empty array
to infinitely many starting at different indexes, e.g., '{}'::int[] !=
'[4:3]={}'::int[]. There may be a certain logic to that, but I'm not
convinced about its usefulness.

Also, it is incompatible with the choice made for empty ranges, which
are all normalised to a single unique empty range value --- the empty
set, with no start- or end-points. I find that quite logical, and so
to me, it makes most sense to also have a single unique empty array,
which is then necessarily dimensionless.

Regards,
Dean



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

Предыдущее
От: Pavel Stehule
Дата:
Сообщение: Re: plpgsql_check_function - rebase for 9.3
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Catching resource leaks during WAL replay