> -----Original Message-----
> From: pgsql-hackers-owner@hub.org [mailto:pgsql-hackers-owner@hub.org]On
> Behalf Of The Hermit Hacker
>
> how about leaving vacuum as is, but extend REINDEX so that it
> drops/rebuilds all indices on a TABLE | DATABASE? Or does it do that
> now? From reading \h REINDEX, my thought is that it doesn't, but ...
>
As for user tables,REINDEX could do it already,i.e REINDEX TABLE table_name FORCE; is possible under psql.
If REINDEX fails,PostgreSQL just ignores the indexes of the table
(i.e Indexscan is never applied) and REINDEX/VACUUM would
recover the state. Yes,VACUUM already has a hidden functionality
to reindex.
As for system indexes,you must shutdown postmaster and
invoke standalone postgres with -P option. REINDEX DATABASE database_name FORCE; would
reindex(shrink) all system tables of the database.
It may be possible even under postmaster if REINDEX
never fails.
Regards.
Hiroshi Inoue
Inoue@tpf.co.jp