Re: (pgsql8.4) DATA Corruption

From: Craig Ringer <ringerc(at)ringerc(dot)id(dot)au>
To: Mik Rose <mrose(at)power-soft(dot)com>
Cc: Scott Marlowe <scott(dot)marlowe(at)gmail(dot)com>, "pgsql-sql(at)postgresql(dot)org" <pgsql-sql(at)postgresql(dot)org>
Subject: Re: (pgsql8.4) DATA Corruption
Date: 2011-08-26 03:51:36
Message-ID: 4E571848.9010504@ringerc.id.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On 20/08/2011 4:27 AM, Mik Rose wrote:
> Thanks for the suggestions Scott.
>
> I was looking at the zero_damage_page option and enabled it in my
> postgres.conf. I saw that it detected bad pages and zero'd them out
> during a number of reindex and a vacuum's.
>
> Now when i reindex though, I am getting this error.
>
> NOTICE: table "pg_foreign_server" was reindexedERROR: could not
> create unique index "pg_toast_57366_index"
> DETAIL: Table contains duplicated values.
>
> ERROR: could not create unique index "pg_toast_57366_index"
> DETAIL: Table contains duplicated values.

You'll have to figure out what what values are duplicates within each
table and DELETE one of them after determining which is the correct one
- if you can. Then you should be able to re-create the index. If the
DELETE fails you might find you have to DROP the index, do the
DELETE(s), then CREATE the index again.

If the index is a partial index (ie it has a WHERE clause) you need to
find duplicates that match that WHERE clause, you can ignore ones that
don't match.

I hope you took a file-system-level backup of your database before
starting to mess with it. People here will normally advise you to do
that first and I'm kind of surprised nobody did.

--
Craig Ringer

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message MIkhail Puzanov 2011-08-26 07:06:23 Re: new table with a select
Previous Message Samuel Gendler 2011-08-26 00:08:11 Re: Need a little help with geometric query