X-Original-To: pgsql-admin@postgresql.org Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 24CDB475B8D for ; Mon, 17 Feb 2003 14:29:03 -0500 (EST) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by postgresql.org (Postfix) with ESMTP id 22EC4475EA9 for ; Mon, 17 Feb 2003 14:28:13 -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 h1HJSC5u010149; Mon, 17 Feb 2003 14:28:13 -0500 (EST) To: Martins Zarins Cc: pgsql-admin@postgresql.org Subject: Re: FATAL 2: open of /usr/local/pgsql/data/pg_clog/0943 failed In-reply-to: <200302172103.27964.mark@vestnesis.lv> References: <200302172103.27964.mark@vestnesis.lv> Comments: In-reply-to Martins Zarins message dated "Mon, 17 Feb 2003 21:03:27 +0200" Date: Mon, 17 Feb 2003 14:28:12 -0500 Message-ID: <10148.1045510092@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200302/264 X-Sequence-Number: 7462 Martins Zarins writes: > FATAL 2: open of /usr/local/pgsql/data/pg_clog/0943 failed: No such file or > directory You evidently have a row with a corrupted transaction number in that table. The system is trying to look up the status of that transaction, and it's failing because the number is far beyond the actually valid range of transaction numbers in your database. Frequently, this failure is just the first detectable symptom of a completely-corrupted page. But it might just be the one row that's bad. If you want to try to narrow down where the corruption is, you can experiment with commands like select ctid,* from big_table offset N limit 1; This will fail with the clog-open error for all N greater than some critical value, which you can home in on by trial and error. Once you know the largest safe N, the ctid reported for that N tells you a block number just before the broken tuple or page. Armed with that, you can look for trouble using a hex editor or pg_filedump (but I recommend pg_filedump --- see http://sources.redhat.com/rhdb/tools.html). If you aren't interested in investigating, you could recover by just dropping the table and recreating it from backup. (I hope you have a backup, as you have certainly lost at least one row and possibly several pages' worth.) In any case, it'd be a good idea to run some memory and disk diagnostics to try to determine what caused the data corruption. regards, tom lane