Hmm. ltree has always had that ARR_NDIM == 1 check. I think the reason the behavior changed is that ARRAY(SELECT ...) used to return a NULL for
zero rows, and now it returns an empty (zero-dimensional) array.

Ah OK that makes sense, especially given the "hack" I used as a workaround, which effectively emulates the old behavior.

I can see two reasonable ways to address this:

* Change the ltree test to reject only ARR_NDIM > 1.

* Drop the ARR_NDIM check altogether, and let it search any sort of
array.

I'm leaning to #2 myself. However, there are probably other places with the same kind of issue, and in some of them it might make more sense to
reject multidimensional arrays.

There may be a third option; it seems to me that the assert is there more to stop unexpected behavior with arrays of dims of 2 or more.

The real solution might be to just convert a 0-dim array into "null" or equivalent and still assert error if dims >= 2?

Alan

--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs

Reply via email to