Re: Duplicate rows during pg_dump

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Jim Nasby <Jim(dot)Nasby(at)BlueTreble(dot)com>
Cc: Marc Mamin <M(dot)Mamin(at)intershop(dot)de>, Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>, Chaz Yoon <chaz(at)shopspring(dot)com>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Duplicate rows during pg_dump
Date: 2015-10-26 02:24:07
Message-ID: 26216.1445826247@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Jim Nasby <Jim(dot)Nasby(at)BlueTreble(dot)com> writes:
> On 10/24/15 3:15 PM, Marc Mamin wrote:
> Any suggestions for what to look for next? Is it table corruption?
>> Most likely is the index corrupt, not the table.
>> You should check for further duplicates, fix them and as Adrian writes,
>> build a new index an then drop the corrupt one.
>>
>> I've seen this a few times before, and if I recall well it was always after some plate got full.
>> Is AWS getting out of space:)

> You should report this to the RDS team, because an out of space
> condition shouldn't leave multiple values in the index. I suspect
> they've made a modification somewhere that is causing this. It could be
> a base Postgres bug, but I'd think we'd have caught such a bug by now...

Notable also is that pg_dump invariably reads tables with a plain "COPY foo"
or "SELECT * FROM foo", which should ignore all indexes and just read the
table contents. So I doubt that reindexing will fix anything: you almost
certainly do have duplicate rows in the base table. It's highly likely
that the index is corrupt, which is what would be necessary to get into
such a state ... but you will need to manually remove the dup rows before
rebuilding the unique index will succeed.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2015-10-26 03:51:59 Re: Recursive Arrays 101
Previous Message John R Pierce 2015-10-26 01:51:57 Re: Recursive Arrays 101