Re: Vacuum problem due to temp tables - Mailing list pgsql-performance

From Tom Lane
Subject Re: Vacuum problem due to temp tables
Date
Msg-id 20323.1298741132@sss.pgh.pa.us
Whole thread Raw
In response to Vacuum problem due to temp tables  (Bhakti Ghatkar <bghatkar@zedo.com>)
Responses Re: Vacuum problem due to temp tables
List pgsql-performance
Bhakti Ghatkar <bghatkar@zedo.com> writes:
> We were running full vacuum on DB when we encountered the error below;

> INFO:  vacuuming "pg_catalog.pg_index"
> *vacuumdb: vacuuming of database "rpt_production" failed: ERROR:  duplicate
> key value violates unique constraint "pg_index_indexrelid_index"*
> DETAIL:  Key (indexrelid)=(2678) already exists.

That's pretty bizarre, but what makes you think it has anything to do
with temp tables?  OID 2678 is pg_index_indexrelid_index itself.
It looks to me like you must have duplicate rows in pg_index for that
index (and maybe others?), and the problem is exposed during vacuum full
because it tries to rebuild the indexes.

Could we see the output of

    select ctid,xmin,xmax,* from pg_index where indexrelid in
      (select indexrelid from pg_index group by 1 having count(*)>1);

            regards, tom lane

pgsql-performance by date:

Previous
From: Dave Johansen
Date:
Subject: Re: Picking out the most recent row using a time stamp column
Next
From: Josh Berkus
Date:
Subject: Re: Picking out the most recent row using a time stamp column