X-Original-To: pgsql-admin@postgresql.org Received: from spampd.localdomain (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id AA45B475F3D for ; Fri, 25 Apr 2003 16:56:33 -0400 (EDT) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by postgresql.org (Postfix) with ESMTP id EA632475F16 for ; Fri, 25 Apr 2003 16:56:32 -0400 (EDT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.9/8.12.9) with ESMTP id h3PKuYU6029958; Fri, 25 Apr 2003 16:56:34 -0400 (EDT) To: vikas.dogra@tabs.toshiba.com (Vikas) Cc: pgsql-admin@postgresql.org Subject: Re: After restoring a database using pg_restore , cannot insert or update records in tables with primary keys In-reply-to: <295585d4.0304231015.49a83e95@posting.google.com> References: <295585d4.0304231015.49a83e95@posting.google.com> Comments: In-reply-to vikas.dogra@tabs.toshiba.com (Vikas) message dated "23 Apr 2003 11:15:36 -0700" Date: Fri, 25 Apr 2003 16:56:33 -0400 Message-ID: <29957.1051304193@sss.pgh.pa.us> From: Tom Lane X-Spam-Status: No, hits=-32.5 required=5.0 tests=BAYES_01,EMAIL_ATTRIBUTION,IN_REP_TO,QUOTED_EMAIL_TEXT, REFERENCES,REPLY_WITH_QUOTES autolearn=ham version=2.50 X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.50 (1.173-2003-02-20-exp) X-Archive-Number: 200304/366 X-Sequence-Number: 8521 vikas.dogra@tabs.toshiba.com (Vikas) writes: > We backup and restore Postgres databases using pg_dump and pg_restore. > Though pg_restore process does not throw any exception but After using > it for restoring we are not able to insert or update records in the > tables having Primary Keys. The message we get is "The primary key is > not a btree." Do you mean "Index is not a btree"? That's the closest match I can find in the sources. This implies that the version code stored in the first page of an index is wrong. If you see this without having gone through spectacular failures (system crashes) then I'd have to bet that there is something very flaky about your hardware. Run some hardware diagnostics --- memtest86 and badblocks are often recommended. (Note that badblocks has been known to miss disk failures unless run in its "destructive" test mode...) regards, tom lane