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

Поиск
Список
Период
Сортировка
От Robert Haas
Тема Re: [PATCH] Exorcise "zero-dimensional" arrays (Was: Re: Should array_length() Return NULL)
Дата
Msg-id CA+Tgmoaj9YoGHv=8DT=JqFE3O0DZYzGJfsTYGeRaXdyu+e548g@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 Tue, Mar 26, 2013 at 4:39 PM, Brendan Jurd <direvus@gmail.com> wrote:
> On 27 March 2013 06:47, Robert Haas <robertmhaas@gmail.com> wrote:
>> On Tue, Mar 26, 2013 at 9:02 AM, Brendan Jurd <direvus@gmail.com> wrote:
>>> We can't sensibly test for whether an array is empty.  I'd call that a
>>> functional problem.
>>
>> Sure you can.  Equality comparisons work just fine.
>>
>> rhaas=# select '{}'::int4[] = '{}'::int4[];
>
> The good news is, if anybody out there is using that idiom to test for
> emptiness, they will not be disrupted by the change.

According to the discussion downthread, apparently they will, because
you're introducing an infinitude of empty arrays, not all of which
compare equal to '{}'::int4.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



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

Предыдущее
От: Amit Kapila
Дата:
Сообщение: Re: Proposal for Allow postgresql.conf values to be changed via SQL [review]
Следующее
От: Robert Haas
Дата:
Сообщение: Re: [PATCH] Exorcise "zero-dimensional" arrays (Was: Re: Should array_length() Return NULL)