Re: Corrupted DB? could not open file pg_clog/####

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: Francisco Reyes <lists(at)stringsutils(dot)com>
Cc: PostgreSQL general <pgsql-general(at)postgresql(dot)org>
Subject: Re: Corrupted DB? could not open file pg_clog/####
Date: 2006-07-31 20:57:42
Message-ID: 20060731205742.GQ29868@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Sun, Jul 30, 2006 at 04:58:34PM -0400, Francisco Reyes wrote:
> Martijn van Oosterhout writes:
>
> >It's still a reasonable suggestion. The maximum offset is the number of
> >rows in the table. You'll notice when the output is empty.
>
> Once I find the point where the output is empty then what?

That's when you've reached the end of the table. The point is that
before then you'll have found the value of N that produces the error.

> How?
> Tried set client_min_message='DEBUG';

That should do it.

> If the pg_clog files are to keep track of transactions, shouldn't a "pg_ctl
> restart" rollback all pending transactions.. so there are no pending
> transactions upon the restart and this error should not appear again?
> Using 8.1.4

It will rollback all pending transactions. The point is that it's
looking for information about transactions that were committed. This is
usually a memory or disk error.

> >However, pg_clog/0000 is the very first transaction file created. Is it
> >in the range of the files that do do exist?
>
> There are 228 files in the directory and the oldest one is "016E" from
> about a month ago.

Sounds like some corrupt data. Once you've located the invalid data,
dump the block with pgfiledump, that should give you more info about
what happened.

Hope this helps,
--
Martijn van Oosterhout <kleptog(at)svana(dot)org> http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Worky Workerson 2006-07-31 21:10:13 Dynamic pgplsql triggers
Previous Message Harald Armin Massa 2006-07-31 20:30:55 Re: Error in PostgreSQL query with psycopg