Simple select give wrong result when it uses the Bitmap Heap Scan path.
postgres=# CREATE OR REPLACE FUNCTION my_exec_im_test_func(i integer) RETURNS integer AS $$ BEGIN RETURN i + 1; END; $$ LANGUAGE plpgsql; CREATE FUNCTION postgres=# set enable_seqscan=off; SET postgres=# set enable_indexscan=off; SET postgres=# select proname from pg_proc where proname like 'my_pro1'; proname ---------------------- my_exec_im_test_proc (1 row) postgres=# explain select proname from pg_proc where proname like 'my_pro1'; QUERY PLAN -------------------------------------------------------------------------------- ------------- Bitmap Heap Scan on pg_proc (cost=4.26..8.27 rows=1 width=64) Recheck Cond: (proname ~~ 'my_pro1'::text) -> Bitmap Index Scan on pg_proc_proname_args_nsp_index (cost=0.00..4.26 row s=1 width=0) Index Cond: ((proname >= 'my'::name) AND (proname < 'mz'::name)) (4 rows) -- Rushabh Lathia www.EnterpriseDB.com