X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id EE0548BA04B for ; Thu, 10 Feb 2005 18:10:45 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 86015-01 for ; Thu, 10 Feb 2005 18:10:37 +0000 (GMT) Received: from candle.pha.pa.us (64-139-89-126-ubr04b-malvrn01-pa.hfc.comcastbusiness.net [64.139.89.126]) by svr1.postgresql.org (Postfix) with ESMTP id 24C728BA014 for ; Thu, 10 Feb 2005 18:10:36 +0000 (GMT) Received: (from pgman@localhost) by candle.pha.pa.us (8.11.6/8.11.6) id j1AIA9E15268; Thu, 10 Feb 2005 13:10:09 -0500 (EST) From: Bruce Momjian Message-Id: <200502101810.j1AIA9E15268@candle.pha.pa.us> Subject: Re: Column duplication with \d in psql In-Reply-To: To: Adam Witney Date: Thu, 10 Feb 2005 13:10:09 -0500 (EST) Cc: pgsql-admin X-Mailer: ELM [version 2.4ME+ PL121 (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.05 tagged_above=0 required=5 tests=FORGED_RCVD_HELO X-Spam-Level: X-Archive-Number: 200502/85 X-Sequence-Number: 16253 Adam Witney wrote: > On 10/2/05 5:45 pm, "Bruce Momjian" wrote: > > > Adam Witney wrote: > >> > >> Something strange has just appeared in my database, can anyone explain this > >> duplication of columns: > >> > >> test=# \d plate_reporter > >> Table "plate_reporter" > >> Column | Type | Modifiers > >> -------------------+---------+-------------------------------------------- > >> plate_reporter_id | integer | not null, > >> plate_reporter_id | integer | not null, > >> plate_id | integer | not null > >> plate_id | integer | not null > >> well_address | text | not null > >> well_address | text | not null > >> reporter_id | integer | not null > >> reporter_id | integer | not null > >> dilution_factor | text | > >> dilution_factor | text | > > > > What version of PostgreSQL are you using? > > select version(); > version > ---------------------------------------------------------------------------- > --------------------------------------------- > PostgreSQL 7.4.6 on powerpc-apple-darwin7.6.0, compiled by GCC gcc (GCC) > 3.3 20030304 (Apple Computer, Inc. build 1495) > (1 row) > > > Old versions could get > > duplicates in some system tables. Do you have a two row for > > 'plate_reporter' in pg_class? > > Ah yes, there are two rows for 'plate_reporter' in pg_class. What would be > the best way of fixing this? Wow, 7.4.6 too. That should never happen. Did you have any hardware reliablity problems like bad disks or RAM? The fix would be to identify which pg_class row is valid and remove the other. If they are the same, use the ctid to remove just one of them. Also check for other possible duplicates in pg_class. This should never happen so I suspect there is some hardware problem on your machine as well. -- Bruce Momjian | http://candle.pha.pa.us pgman@candle.pha.pa.us | (610) 359-1001 + If your life is a hard drive, | 13 Roberts Road + Christ can be your backup. | Newtown Square, Pennsylvania 19073