Re: What should I do after a power loss? - Mailing list pgsql-novice

From Kevin Grittner
Subject Re: What should I do after a power loss?
Date
Msg-id 474301882.3947634.1439927313250.JavaMail.yahoo@mail.yahoo.com
Whole thread Raw
In response to What should I do after a power loss?  (Patrik Karlsson <pata.karlsson@gmail.com>)
Responses Re: What should I do after a power loss?  (Patrik Karlsson <pata.karlsson@gmail.com>)
List pgsql-novice
Patrik Karlsson <pata.karlsson@gmail.com> wrote:

> I had a power loss on a Windows 7 machine running PostgreSQL
> 9.4.4.

Kudos on being up-to-date with minor releases -- that alone rules
out some possible data corruption problems.

> After booting, the database started just fine and so did the
> program that stores information into the database. As far as I
> can tell that is. (And I cant tell that much since postgres is
> new to me)

As long as you were running with fsync = on and full_page_writes =
on, and the OS and hardware honor fsync requests, your database
should not have been corrupted.  If you were running with
synchronous_commit = on then any commit request (or DML outside of
an explict transaction) which completed without error should be
reflected in the database.  If you were running with
synchronous_commit = off you might have a small number of commits
which are not reflected (usually a fraction of a second's worth).

> My backup at the time was 6 hours old but for the last 24 hours I
> have been storing new data into the database.

It sounds unlikely that you will need to go back to the backup, but
out of paranoia I would keep that particular backup around for a
few months, in addition to the usual backup rotation.

> I would like to confirm that everything is ok, how can I do that,
> (with pgAdmin)?

PostgreSQL is designed to come back from such an event without data
loss or corruption, and there is no one tool to comprehensively
look for all forms of inconsistency.  You might want to consider
running pg_catcheck, just to make sure it doesn't find anything
odd.

https://github.com/EnterpriseDB/pg_catcheck

--
Kevin Grittner
EDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

pgsql-novice by date:

Previous
From: Eric Raskin
Date:
Subject: Re: Problem with search_path and creating objects
Next
From: Tom Lane
Date:
Subject: Re: Help with search_path setting - can't create objects