"Lawrence Cohan" <lawrencec@1shoppingcart.com> writes:
> We rely on this column to build a list of tables restricted to only those
> that have indexes to be rebuilt with CONCURRENTLY however the column is not
> updated as documentation says by the vacuum. After a successful
> analyze/vacuum/analyze against the entire database ALL tables from pg_class
> have the pg_class.relhasindex = true even if they don't have any indexes.
Works as documented for me ...
regression=# create table foo(f1 int);
CREATE TABLE
regression=# select relhasindex from pg_class where relname = 'foo';
relhasindex
-------------
f
(1 row)
regression=# create index fooi on foo(f1);
CREATE INDEX
regression=# select relhasindex from pg_class where relname = 'foo';
relhasindex
-------------
t
(1 row)
regression=# drop index fooi;
DROP INDEX
regression=# select relhasindex from pg_class where relname = 'foo';
relhasindex
-------------
t
(1 row)
regression=# vacuum foo;
VACUUM
regression=# select relhasindex from pg_class where relname = 'foo';
relhasindex
-------------
f
(1 row)
regards, tom lane