Re: Some array semantics issues - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Some array semantics issues
Date
Msg-id 11013.1132176172@sss.pgh.pa.us
Whole thread Raw
In response to Re: Some array semantics issues  (David Fetter <david@fetter.org>)
List pgsql-hackers
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


pgsql-hackers by date:

Previous
From: David Fetter
Date:
Subject: Re: Some array semantics issues
Next
From: Dave Cramer
Date:
Subject: PANIC: could not locate a valid checkpoint record