Re: postgres crash - Mailing list pgsql-novice

From Tom Lane
Subject Re: postgres crash
Date
Msg-id 20933.1312396065@sss.pgh.pa.us
Whole thread Raw
In response to postgres crash  (mattfairley@netscape.net)
Responses Re: postgres crash  (Matthew Fairley <mattfairley@netscape.net>)
List pgsql-novice
mattfairley@netscape.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

pgsql-novice by date:

Previous
From: mattfairley@netscape.net
Date:
Subject: postgres crash
Next
From: Matthew Fairley
Date:
Subject: Re: postgres crash