Re: Vacuumdb error - Mailing list pgsql-general

From Tom Lane
Subject Re: Vacuumdb error
Date
Msg-id 426.1302899610@sss.pgh.pa.us
Whole thread Raw
In response to Re: Vacuumdb error  (Carl von Clausewitz <clausewitz45@gmail.com>)
List pgsql-general
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

pgsql-general by date:

Previous
From: Jerry Sievers
Date:
Subject: Re: How to silence constraint violation logging for an INSERT
Next
From: Edison So
Date:
Subject: Help: pg_restore failure