X-Original-To: pgsql-admin@postgresql.org Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 7A2C0474E44 for ; Thu, 6 Feb 2003 10:06:00 -0500 (EST) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by postgresql.org (Postfix) with ESMTP id 81A1747592C for ; Thu, 6 Feb 2003 10:05:59 -0500 (EST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.6/8.12.6) with ESMTP id h16F5x5u012348; Thu, 6 Feb 2003 10:05:59 -0500 (EST) To: cjwhite@cisco.com Cc: pgsql-admin@postgresql.org Subject: Re: Duplicate indexes found in the postgres Database In-reply-to: <00d401c2cd66$92583dd0$ff926b80@amer.cisco.com> References: <00d401c2cd66$92583dd0$ff926b80@amer.cisco.com> Comments: In-reply-to "Chris White" message dated "Wed, 05 Feb 2003 14:33:13 -0800" Date: Thu, 06 Feb 2003 10:05:59 -0500 Message-ID: <12347.1044543959@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200302/84 X-Sequence-Number: 7282 "Chris White" writes: > User was able to recreate the problem, but this time only on table got > duplicated 'gui_config'. So here is the info you wanted: > select ctid,xmin,xmax,oid,* from pg_class where relname = 'gui_config'; > ctid | xmin | xmax | oid | relname | reltype | relowner | relam | > relfilenode | relpages | reltuples | reltoastrelid | reltoastidxid | > relhasindex | relisshared | relkind | relnatts | relchecks | reltriggers | > relukeys | relfkeys | relrefs | relhasoids | relhaspkey | relhasrules | > relhassubclass | relacl > --------+------+------+-------+------------+---------+----------+-------+--- > ----------+----------+-----------+---------------+---------------+---------- > ---+-------------+---------+----------+-----------+-------------+----------+ > ----------+---------+------------+------------+-------------+--------------- > -+----------------------- > (2,54) | 176 | 191 | 16560 | gui_config | 16561 | 101 | 0 | > 16560 | 10 | 1000 | 0 | 0 | t | > f | r | 2 | 0 | 0 | 0 | > 0 | 0 | t | t | f | f | > {=,aesop_gui=arwdRxt} > (2,56) | 191 | 206 | 16560 | gui_config | 16561 | 101 | 0 | > 16560 | 10 | 1000 | 0 | 0 | t | > f | r | 2 | 0 | 0 | 0 | > 0 | 0 | t | t | f | f | > {=,aesop_gui=arwdRxt} > (2 rows) Hmm ... this looks much like the duplicate-tuple issues we were looking at last month. Transaction 191 tried to update the row (though it's not clear why, since none of the fields seem to have changed). But only one of the two rows should be considered good --- either 191 committed or it didn't. Something's gotten out of sync between the pg_class table file and the pg_clog transaction commit status data. The only known ways for that to happen involve system crashes just after a checkpoint, or pilot error like trying to use a "tar" dump of an active database as a backup. Is this a freshly-initdb'd database? Transaction number 191 seems very small. Do you have a procedure to reproduce the problem? Can you at least describe what your user did? regards, tom lane