Re: postgres crash

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: mattfairley(at)netscape(dot)net
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: postgres crash
Date: 2011-08-03 18:27:45
Message-ID: 20933.1312396065@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

mattfairley(at)netscape(dot)net writes:
> I am a complete newb with postgres. In fact, I don't even use it as
> such but have a problem with a crashed postgresql db associated with
> using Calendar Server on Mac OS X 10.6 on a Mac Mini. To cut a long
> story short, I had to reformat my hard drive and restore form a Time
> Machine backup.

Yeah, that's not exactly the approved way to back up a Postgres
instance; you're likely to get a collection of files that are somewhat
out-of-sync with each other, which seems to be exactly what this is
about:

> LOG: database system was interrupted; last known up at 2011-07-15 07:48:24 BST
> LOG: unexpected pageaddr 0/2058000 in log file 0, segment 4, offset 360448
> LOG: invalid primary checkpoint record
> LOG: unexpected pageaddr 0/2056000 in log file 0, segment 4, offset 352256
> LOG: invalid secondary checkpoint record
> PANIC: could not locate a valid checkpoint record

> I've tried using pg_resetxlog with the -f switch but I don't really know what I'm doing.

pg_resetxlog is pretty much the only way out, given that you don't have
any other form of backup. But you haven't shown us exactly what you did
or exactly how it failed.

The man page for pg_resetxlog is reasonably thorough, did you read it?
http://www.postgresql.org/docs/9.0/static/app-pgresetxlog.html

(Once you do get it to start again, you'll at minimum want to do a
complete database reindex, and ideally a dump/re-initdb/reload, to try
to make sure there's not lingering database corruption.)

regards, tom lane

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Matthew Fairley 2011-08-03 20:15:14 Re: postgres crash
Previous Message mattfairley 2011-08-03 17:41:19 postgres crash