Re: testing database consistency - Mailing list pgsql-admin

From Albe Laurenz
Subject Re: testing database consistency
Date
Msg-id A737B7A37273E048B164557ADEF4A58B17C523A0@ntex2010i.host.magwien.gv.at
Whole thread Raw
In response to testing database consistency  (Raphael Bauduin <rblists@gmail.com>)
Responses Re: testing database consistency
List pgsql-admin
Raphael Bauduin wrote:
> I have a postgresql running in a virtual machine (linux, kvm).
> I wanted to test that the backup, which takes a copy of the disk image, is valid and usable.
> 
> I have taken a copy of the disk image and run it fine on another computer.
> However, just starting the server succesfully does not mean there is no corrupted data in the
> database. This is why I'm looking to a way to validate that all the data stored in the postgresql is
> ok, ie consistent and usable. Does anyone have advices on how to best check the validity of the whole
> database?

There is no safe way (unless you were running on 9.3 with checksums).

The best thing you can do is run a SELECT * from all tables and see
if that succeeds.
Also, rebuild all indexes if there are doubts whether they are valid or not.

Yours,
Laurenz Albe

pgsql-admin by date:

Previous
From: "Plugge, Joe R."
Date:
Subject: Re: Huge increase of database partition
Next
From: Scott Ribe
Date:
Subject: Re: testing database consistency