Re: [SQL] Duplicate tuples with unique index - Mailing list pgsql-sql

From Tom Lane
Subject Re: [SQL] Duplicate tuples with unique index
Date
Msg-id 4877.948471782@sss.pgh.pa.us
Whole thread Raw
In response to Duplicate tuples with unique index  (Patrik Kudo <kudo@partitur.se>)
List pgsql-sql
Patrik Kudo <kudo@partitur.se> writes:
> db=> vacuum ;       
> NOTICE:  Rel pg_statistic: TID 1/93: OID IS INVALID. TUPGONE 0.
> NOTICE:  Index html_text_idx: NUMBER OF INDEX' TUPLES (1193) IS NOT THE
> SAME AS HEAP' (1258)
> ERROR:  Cannot insert a duplicate key into a unique index

Given the reference to pg_statistic, I wonder if you aren't getting
burnt by the recently-discovered bug wherein VACUUM ANALYZE tries to
create pg_statistic tuples that are too long.  I recommend (a) patch
vacuum.c (see Dirk Lutzebaeck's nearby message); then (b) drop and
recreate html_text_idx; finally (c) DELETE FROM pg_statistic and
then VACUUM ANALYZE to rebuild it.  Good luck!
        regards, tom lane


pgsql-sql by date:

Previous
From: Dirk Lutzebaeck
Date:
Subject: Re: [SQL] Problem with large tuples.
Next
From: Brook Milligan
Date:
Subject: DISTINCT and aggregates