problem after REINDEX command
problem after REINDEX command
От:
"Patrick Fiche" <patrick.fiche@aqsacom.com>
Дата:
I'm having trouble with pg_statistic table. I tried to reindex my database with command REINDEX DATABASE EASYSHARE FORCE I had the error : "Cannot create unique index. Table contains non-unique values" The index was pg_statistic_relid_att_index In fact, when I execute the query : SELECT starelid, staattnum, count(*) from pg_statistic group by starelid, staattnum having count(*) > 1 I get some tuples ( 16584, 1, 2 ), ( 16584, 2, 2 ), ( 16584, 3, 2), ( 16584, 5, 2), ( 16584, 9, 2 ) and ( 16584, 10, 2 ) Relation 16584 is a user table... The only solution is to empty the table pg_statistic and recreate the index with the following command CREATE UNIQUE INDEX pg_statistic_relid_att_index ON pg_statistic USING BTREE( starelid, staattnum ) and then run REINDEX with FORCE flag... I'm using 7.2.3 Patrick Fiche email : patrick.fiche@aqsacom.com tél : 01 69 29 36 18