Re: GIN overlap vs empty arrays - Mailing list pgsql-bugs

From Tom Lane
Subject Re: GIN overlap vs empty arrays
Date
Msg-id 18820.1269531859@sss.pgh.pa.us
Whole thread Raw
In response to GIN overlap vs empty arrays  (Jeff <threshar@torgo.978.org>)
Responses Re: GIN overlap vs empty arrays  (Jeff <threshar@torgo.978.org>)
List pgsql-bugs
Jeff <threshar@threshar.is-a-geek.com> writes:
> Ran into this and I'm trying to decide if this is functioning as
> designed or if this is a bug that should be fixed: (PG 8.4.2)

> create table gintest
> (
>     idList int[],
>     foo text
> );

> create index gintest_gin_idx on gintest using gin(idList gin__int_ops);

> insert into gintest(idlist, foo) values (array[1,2,3], 'bar');

> select * from gintest where idList && array[]::int[];

> CREATE TABLE
> CREATE INDEX
> INSERT 0 1
> psql:ginproblem.sql:11: ERROR:  GIN indexes do not support whole-index
> scans

Hmm, that case is supposed to work, in 8.3 and later ... but it doesn't
because of a stupid typo in contrib/intarray.


Index: _int_gin.c
===================================================================
RCS file: /cvsroot/pgsql/contrib/intarray/_int_gin.c,v
retrieving revision 1.10
diff -c -r1.10 _int_gin.c
*** _int_gin.c    11 Jun 2009 14:48:51 -0000    1.10
--- _int_gin.c    25 Mar 2010 15:37:56 -0000
***************
*** 65,71 ****
          }
      }

!     if (nentries == 0)
      {
          switch (strategy)
          {
--- 65,71 ----
          }
      }

!     if (*nentries == 0)
      {
          switch (strategy)
          {


Sometimes C is not the most helpful language to work in.

            regards, tom lane

pgsql-bugs by date:

Previous
From: Jeff
Date:
Subject: GIN overlap vs empty arrays
Next
From: "Hiroshi Saito"
Date:
Subject: Re: UTF-8 encoding failure