pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Martins Zarins <mark@vestnesis.lv>
Cc: pgsql-admin@postgresql.org
Subject: Re: FATAL 2: open of /usr/local/pgsql/data/pg_clog/0943 failed
Date: Mon, 17 Feb 2003 14:28:12 -0500
Message-ID: <10148.1045510092@sss.pgh.pa.us> (raw)
In-Reply-To: <200302172103.27964.mark@vestnesis.lv>
References: <200302172103.27964.mark@vestnesis.lv>

Martins Zarins <mark@vestnesis.lv> 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



view thread (3+ messages)

Message-ID: <10148.1045510092@sss.pgh.pa.us>
Permalink:  ../10148.1045510092@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/10148.1045510092@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: tgl@sss.pgh.pa.us, mark@vestnesis.lv
  Subject: Re: FATAL 2: open of /usr/local/pgsql/data/pg_clog/0943 failed
  In-Reply-To: <10148.1045510092@sss.pgh.pa.us>
  References: <200302172103.27964.mark@vestnesis.lv> <10148.1045510092@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox