David Fetter <david@fetter.org> writes:
> On Wed, Nov 16, 2005 at 03:03:53PM -0500, Greg Stark wrote:
>> It occurs to me that it would also make sense to have an operator
>> that considered the arrays in an order-insensitive comparison.
> That sounds more like the SQL:2003 MULTISET, which is essentially
> unordered. Any plans for these?
Seems to me it would be really expensive to try to make such a
comparison directly with the present array representation. The
only sensible way to do it would be to sort the elements of the
two arrays (using the comparison operator of the element data type)
and then compare the results. So you don't actually need a variant
equality operator, you just need a generic array_sort() function,
and then go "array_sort(x) = array_sort(y)". Such a function might
have other uses besides this, too.
regards, tom lane