Re: multiset patch review - Mailing list pgsql-hackers

From Itagaki Takahiro
Subject Re: multiset patch review
Date
Msg-id AANLkTikya-j2Ty-aN+pQ4eFr8rxbh83aNdR8xoLk4TpX@mail.gmail.com
Whole thread Raw
In response to Re: multiset patch review  (Itagaki Takahiro <itagaki.takahiro@gmail.com>)
Responses Re: multiset patch review  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
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

Attachment

pgsql-hackers by date:

Previous
From: Fujii Masao
Date:
Subject: Re: Include WAL in base backup
Next
From: Magnus Hagander
Date:
Subject: Re: Include WAL in base backup