Re: starting postgres with an empty px_xlog folder - Mailing list pgsql-admin

From Kevin Grittner
Subject Re: starting postgres with an empty px_xlog folder
Date
Msg-id 4FE5D68A0200002500048A32@gw.wicourts.gov
Whole thread Raw
In response to starting postgres with an empty px_xlog folder  (Mike Broers <mbroers@gmail.com>)
Responses Re: starting postgres with an empty px_xlog folder  (Craig Ringer <ringerc@ringerc.id.au>)
List pgsql-admin
Mike Broers  wrote:
> Mike Broers  wrote:

>> We shut down our postgres 8.3 server last night cleanly for some
>> hosted services maintenance. When we got our server back, it didnt
>> have the pg_xlog mount with files and now when we start the
>> server, it complains

>> Since we had a clean shut down is there an easy or relatively
>> clean way to start back up? the pg_xlog folder is there, just with
>> no files. i wouldnt think it would be needed for a clean restart.

It is.

> I was able to duplicate the error in a test environment and get the
> database started back up wtih the pg_resetxlog $PGDATA command, but
> i am concerned about the fallout and not sure if i need to use any
> of the option switches. We also have archived log files up to the
> point of server shutdown if that provides a better option.

I would make a copy of the directory tree of the database cluster
while the server is stopped before attempting any recovery.

http://wiki.postgresql.org/wiki/Corruption

The archived WAL files, may provide a better option that
pg_resetxlog.

If it were my data, I would be inclined to use pg_dump to create a
fresh version of the database after recovery, although if you really
have a full set of archived WAL files and the server starts up
without any indications of problems in the server log, you might be
OK without doing that.

As previously stated, make sure you understand how this happened, so
you can make sure it doesn't happen again.  The contents of the
pg_xlog directory are an integral part of your database cluster.

-Kevin

pgsql-admin by date:

Previous
From: Ray Stell
Date:
Subject: Re: starting postgres with an empty px_xlog folder
Next
From: Greg Williamson
Date:
Subject: Re: autovac hitting too many tables at once