9.3: Empty arrays returned by array_remove()

Поиск
Список
Период
Сортировка
От Dean Rasheed
Тема 9.3: Empty arrays returned by array_remove()
Дата
Msg-id CAEZATCXEuJoj3v9RTYYZ0vMDQ4YmmiaA7s+7u096BVbeimW-eQ@mail.gmail.com
обсуждение исходный текст
Ответы Re: 9.3: Empty arrays returned by array_remove()
Список pgsql-hackers
Testing 9.3beta, it seems that array_remove() may return an empty 1-d
array whose upper bound is lower than its lower bound. I know that we
discussed allowing this kind of array, but I don't think that
discussion reached any conclusion, other than to agree that the
current empty 0-d array behaviour would be kept in 9.3.

I don't think it's intentional, but the current code in array_remove()
can return something like this:

SELECT array_dims(array_remove(array[1], 1));array_dims
------------[1:0]
(1 row)

and so the resulting empty 1-d array won't compare as equal to the
usual 0-d empty array:

SELECT array_remove(array[1], 1) = '{}';?column?
----------f
(1 row)

The LHS is effectively '[1:0]={}', but we don't currently allow that
syntax, so I don't think we should be returning it (it wouldn't
survive a dump/restore, for example).

Regards,
Dean



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

Предыдущее
От: Sawada Masahiko
Дата:
Сообщение: Re: Behavior of a pg_trgm index for 2 (or < 3) character LIKE queries
Следующее
От: Jeff Davis
Дата:
Сообщение: Re: Eliminating PD_ALL_VISIBLE, take 2