Re: BUG #6530: intarray documentation could do with a warning about operators

Lists: pgsql-bugs
From: kontakt(at)sandberg-consult(dot)dk
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #6530: intarray documentation could do with a warning about operators
Date: 2012-03-13 17:12:28
Message-ID: E1S7VGu-0004T8-NT@wrigleys.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs

The following bug has been logged on the website:

Bug reference: 6530
Logged by: Kasper Sandberg
Email address: kontakt(at)sandberg-consult(dot)dk
PostgreSQL version: 9.1.3
Operating system: Debian squeeze
Description:

Hello.

I recently had a problem with array operators && and @> on my gin index, it
failed. Friendly people on #postgresql helped me track down the root cause -
intarray, which i had just imported into my schema. I think it would be nice
if the documentation for intarray on the documentations page had a short
warning about this, so people can import into other schemas if they need to
use the default array operators.

Thanks.


From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: kontakt(at)sandberg-consult(dot)dk
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #6530: intarray documentation could do with a warning about operators
Date: 2012-04-09 14:08:57
Message-ID: CA+TgmoaMqMJBpONW9HRhH95yidzjvf1EjF-oVgmFFD_ReFnKAQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs

On Tue, Mar 13, 2012 at 1:12 PM, <kontakt(at)sandberg-consult(dot)dk> wrote:
> The following bug has been logged on the website:
>
> Bug reference:      6530
> Logged by:          Kasper Sandberg
> Email address:      kontakt(at)sandberg-consult(dot)dk
> PostgreSQL version: 9.1.3
> Operating system:   Debian squeeze
> Description:
>
> Hello.
>
> I recently had a problem with array operators && and @> on my gin index, it
> failed. Friendly people on #postgresql helped me track down the root cause -
> intarray, which i had just imported into my schema. I think it would be nice
> if the documentation for intarray on the documentations page had a short
> warning about this, so people can import into other schemas if they need to
> use the default array operators.
>
> Thanks.

We do have this:

<para>
The operators <literal>&amp;&amp;</>, <literal>@&gt;</> and
<literal>&lt;@</> are equivalent to <productname>PostgreSQL</>'s built-in
operators of the same names, except that they work only on integer arrays
that do not contain nulls, while the built-in operators work for any array
type. This restriction makes them faster than the built-in operators
in many cases.
</para>

But maybe some more explicit warning is needed. Not sure exactly what.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: kontakt(at)sandberg-consult(dot)dk, pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #6530: intarray documentation could do with a warning about operators
Date: 2012-04-09 16:16:29
Message-ID: 8741.1333988189@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs

Robert Haas <robertmhaas(at)gmail(dot)com> writes:
> We do have this:

> <para>
> The operators <literal>&amp;&amp;</>, <literal>@&gt;</> and
> <literal>&lt;@</> are equivalent to <productname>PostgreSQL</>'s built-in
> operators of the same names, except that they work only on integer arrays
> that do not contain nulls, while the built-in operators work for any array
> type. This restriction makes them faster than the built-in operators
> in many cases.
> </para>

> But maybe some more explicit warning is needed. Not sure exactly what.

I think the gripe is basically that, while these operators might be
equivalent to the built-in ones as far as results go, they are not
equivalent in terms of their ability to match to indexes. But not
sure how we turn that observation into useful documentation.

regards, tom lane


From: Kasper Sandberg <kontakt(at)sandberg-consult(dot)dk>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #6530: intarray documentation could do with a warning about operators
Date: 2012-04-09 16:21:56
Message-ID: 4F830CA4.8090808@sandberg-consult.dk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs

yes, I could not figure out why my GIN index was not used, this is what
i meant.

On 09/04/12 18:16, Tom Lane wrote:
> Robert Haas<robertmhaas(at)gmail(dot)com> writes:
>> We do have this:
>> <para>
>> The operators<literal>&amp;&amp;</>,<literal>@&gt;</> and
>> <literal>&lt;@</> are equivalent to<productname>PostgreSQL</>'s built-in
>> operators of the same names, except that they work only on integer arrays
>> that do not contain nulls, while the built-in operators work for any array
>> type. This restriction makes them faster than the built-in operators
>> in many cases.
>> </para>
>> But maybe some more explicit warning is needed. Not sure exactly what.
> I think the gripe is basically that, while these operators might be
> equivalent to the built-in ones as far as results go, they are not
> equivalent in terms of their ability to match to indexes. But not
> sure how we turn that observation into useful documentation.
>
> regards, tom lane

--
Kasper Sandberg
Sandberg Enterprises
+45 51944242
http://www.sandbergenterprises.dk