Hi,
GIN partial match appears to be broken after fast scan. Following simple test case raises assertion failure.
create extension btree_gin;
create table test as (select id, random() as val from generate_series(1,1000000) id);
create index test_idx on test using gin (val);
vacuum test;
select * from test where val between 0.1 and 0.9;
Attached patch fixes bugs in entryGetItem function.
I would especially point that "continue;" checks "while" condition even if it's postfix "while". That's why I surrounded tbm_iterate with another "while".
------
With best regards,
Alexander Korotkov.