unexpected query failure: ERROR: GIN indexes do not support whole-index scans

Поиск
Список
Период
Сортировка
От Jon Nelson
Тема unexpected query failure: ERROR: GIN indexes do not support whole-index scans
Дата
Msg-id AANLkTi=KzCrUTqZa_zXa8-T8afGbc9OCgAn7Ex2emnyQ@mail.gmail.com
обсуждение исходный текст
Ответы Re: unexpected query failure: ERROR: GIN indexes do not support whole-index scans
Список pgsql-performance
I have a table with an array column.
I added a GIN index to the array:

CREATE INDEX foo_idx ON t USING GIN (alternatecodes) WHERE
alternatecodes IS NOT NULL;

That's all well and good.
However, some queries started failing and I was able to reproduce the
behavior in psql!

SELECT * FROM t WHERE alternatecodes IS NOT NULL;
returns:
ERROR:  GIN indexes do not support whole-index scans

Whaaa?  Adding an *index* makes my /queries/ stop working? How can this be?
This really violated my principle of least surprise. If GIN indexes
don't support whole-index scans, fine, don't use them, but don't make
a perfectly valid query fail because of it.

This seems like a bug. Is it?

PostgreSQL version:

 PostgreSQL 8.4.5 on x86_64-redhat-linux-gnu, compiled by GCC gcc
(GCC) 4.1.2 20080704 (Red Hat 4.1.2-48), 64-bit


--
Jon

В списке pgsql-performance по дате отправления:

Предыдущее
От: Josh Kupershmidt
Дата:
Сообщение: Re: how to get the total number of records in report
Следующее
От: Tom Lane
Дата:
Сообщение: Re: unexpected query failure: ERROR: GIN indexes do not support whole-index scans