Carl von Clausewitz <clausewitz45@gmail.com> writes:
>>> sqlstate=23505ERROR: duplicate key value violates unique constraint
>>> "pg_index_indexrelid_index"
>>> sqlstate=23505DETAIL: Key (indexrelid)=(2678) already exists.
After a considerable amount of fooling around I've been able to
reproduce this and identify the cause:
http://archives.postgresql.org/pgsql-hackers/2011-04/msg00777.php
A real fix will be forthcoming in the next update releases (not Monday's
updates, unfortunately; too late for that). In the meantime, it appears
that the problem can only be triggered by a sequence that involves
*both* REINDEX and VACUUM FULL on pg_index. Since, as I mentioned
before, a separate reindex step is completely useless when using 9.0's
VACUUM FULL, removing the reindex step from your maintenance script
should be an adequate workaround.
regards, tom lane