pgsql: Allow zero-dimensional (ie, empty) arrays in contrib/ltree

Поиск
Список
Период
Сортировка
От tgl@postgresql.org (Tom Lane)
Тема pgsql: Allow zero-dimensional (ie, empty) arrays in contrib/ltree
Дата
Msg-id 20100224180230.228117541D0@cvs.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Log Message:
-----------
Allow zero-dimensional (ie, empty) arrays in contrib/ltree operations.

The main motivation for changing this is bug #4921, in which it's pointed out
that it's no longer safe to apply ltree operations to the result of
ARRAY(SELECT ...) if the sub-select might return no rows.  Before 8.3,
the ARRAY() construct would return NULL, which might or might not be helpful
but at least it wouldn't result in an error.  Now it returns an empty array
which results in a failure for no good reason, since the ltree operations
are all perfectly capable of dealing with zero-element arrays.

As far as I can find, these ltree functions are the only places where zero
array dimensionality is rejected unnecessarily.

Back-patch to 8.3 to prevent behavioral regression of queries that worked
in older releases.

Tags:
----
REL8_4_STABLE

Modified Files:
--------------
    pgsql/contrib/ltree:
        _ltree_gist.c (r1.26 -> r1.26.2.1)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/contrib/ltree/_ltree_gist.c?r1=1.26&r2=1.26.2.1)
        _ltree_op.c (r1.13 -> r1.13.2.1)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/contrib/ltree/_ltree_op.c?r1=1.13&r2=1.13.2.1)
        lquery_op.c (r1.14 -> r1.14.2.1)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/contrib/ltree/lquery_op.c?r1=1.14&r2=1.14.2.1)
        ltree_gist.c (r1.25 -> r1.25.2.1)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/contrib/ltree/ltree_gist.c?r1=1.25&r2=1.25.2.1)

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

Предыдущее
От: tgl@postgresql.org (Tom Lane)
Дата:
Сообщение: pgsql: Allow zero-dimensional (ie, empty) arrays in contrib/ltree
Следующее
От: tgl@postgresql.org (Tom Lane)
Дата:
Сообщение: pgsql: Allow zero-dimensional (ie, empty) arrays in contrib/ltree