Re: major database breakdown - Mailing list pgsql-general

From Tom Lane
Subject Re: major database breakdown
Date
Msg-id 13810.1092669807@sss.pgh.pa.us
Whole thread Raw
In response to major database breakdown  (Ulrich Wisser <ulrich.wisser@relevanttraffic.se>)
Responses Re: major database breakdown
List pgsql-general
Ulrich Wisser <ulrich.wisser@relevanttraffic.se> writes:
> backend> REINDEX DATABASE "CLIX1"
> NOTICE:  relation 16416 was reindexed
> NOTICE:  relation 1255 was reindexed
> ...
> NOTICE:  relation 16384 was reindexed
> NOTICE:  relation 16386 was reindexed
> ERROR:  Cannot create unique index. Table contains non-unique values
> backend>

> Which relation is that? How can I find that relation?

I think this process will run in order of entries in pg_class.  Try
    SELECT oid, relname FROM pg_class
    WHERE relkind = 'r' AND relnamespace = 11
and see if the OIDs seem to match up with the NOTICEs.  If so you can
probably assume that the next one after 16386 is the problem.

Another approach is just to individually reindex the tables that are
giving you trouble (pg_class, pg_statistic).  Also keep in mind that
pg_statistic is noncritical data --- if all else fails, just do a
    DELETE FROM pg_statistic
and then reindex it.

            regards, tom lane

pgsql-general by date:

Previous
From: Renê Salomão
Date:
Subject: Problem when installing dbsize of PG 8.0-beta1
Next
From: Bruce Momjian
Date:
Subject: Re: Problem when installing dbsize of PG 8.0-beta1