On Tue, Jan 18, 2011 at 17:39, Itagaki Takahiro
<itagaki.takahiro@gmail.com> wrote:
> BTW, should we use an "operator" to represent SUBMULTISET OF ?
I did it in the attached patch. Also, I fixed a bug of NULL checks
in SUBMULTISET OF operator.
Now SUBMULTISET OF is an alias to the new <& operator. We also have
&> operator as the commutator. They are different from <@ and @>
operators because they considers the number of elements.
For example:
=# SELECT ARRAY[1,1] <@ ARRAY[1], ARRAY[1,1] <& ARRAY[1];
?column? | ?column?
----------+----------
t | f
(1 row)
GIN still doesn't support <& and &> operators because of NULL handling.
In the spec, all values including NULLs should be returned for an empty
array key (i.e, "WHERE ARRAY[] SUBMULTISET OF array_col" returns everything),
but the current GIN implementation won't return NULL values for non-NULL keys.
Since it requires changes in GIN, I'd like to postpone gin support to the next
development cycle for 9.2.
--
Itagaki Takahiro