X-Original-To: pgsql-admin-postgresql.org@postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 875DC9FB4C7 for ; Fri, 1 Sep 2006 10:09:56 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 84177-04-7 for ; Fri, 1 Sep 2006 10:06:37 -0300 (ADT) X-Greylist: delayed 00:52:49.271988 by SQLgrey- Received: from mail714.megamailservers.com (mail714.megamailservers.com [69.49.98.24]) by postgresql.org (Postfix) with ESMTP id 153799FB493 for ; Fri, 1 Sep 2006 09:55:22 -0300 (ADT) X-Authenticated-User: paul.a.pnlassociates.com Received: from [69.3.2.106] (h-69-3-2-106.mclnva23.covad.net [69.3.2.106]) (authenticated bits=0) by mail714.megamailservers.com (8.13.6/8.13.1) with ESMTP id k81C2OoQ029659 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Fri, 1 Sep 2006 08:02:30 -0400 Message-ID: <44F82150.5000809@pnlassociates.com> Date: Fri, 01 Sep 2006 08:02:24 -0400 From: "Paul B. Anderson" User-Agent: Thunderbird 1.5.0.5 (Macintosh/20060719) MIME-Version: 1.0 To: "[ADMIN]" Subject: Vacuum error on database postgres Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.294 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200609/3 X-Sequence-Number: 22917 I'm running postgreSQL 8.1.4 on Red Hat Enterprise Linux 3. Things have been working well for a while but in the last few days, I've gotten the following error during a nightly vacuum. postgres=# vacuum analyze; ERROR: duplicate key violates unique constraint "pg_statistic_relid_att_index" I can vacuum that table individually without problems. postgres=# vacuum pg_statistic; VACUUM postgres=# vacuum analyze pg_statistic; VACUUM postgres=# I found a posting from 2004 that suggested the following query. postgres=# select starelid, staattnum, count(*) from pg_statistic group by 1,2 having count(*) > 1; starelid | staattnum | count ----------+-----------+------- 2608 | 3 | 2 10723 | 7 | 2 10723 | 4 | 2 10723 | 5 | 2 10723 | 2 | 2 10723 | 3 | 2 10728 | 1 | 2 10728 | 2 | 2 10728 | 3 | 2 10728 | 4 | 2 10728 | 5 | 2 10738 | 1 | 2 (12 rows) I did delete exactly one of each of these using ctid and the query then shows no duplicates. But, the problem comes right back in the next database-wide vacuum. I think the objects are as given below. postgres=# select relname,oid,reltype from pg_class where oid in (2608,10723,10728,10738); relname | oid | reltype -------------------------+-------+--------- sql_features | 10723 | 10724 sql_implementation_info | 10728 | 10729 sql_packages | 10738 | 10739 pg_depend | 2608 | 10277 (4 rows) I also tried reindexing the table. postgres=# reindex table pg_statistic; ERROR: could not create unique index DETAIL: Table contains duplicated values. postgres=# Help! Paul