Re: testing database consistency

From: Albe Laurenz <laurenz(dot)albe(at)wien(dot)gv(dot)at>
To: "Raphael Bauduin *EXTERN*" <rblists(at)gmail(dot)com>, "pgsql-admin(at)postgresql(dot)org" <pgsql-admin(at)postgresql(dot)org>
Subject: Re: testing database consistency
Date: 2013-10-25 09:00:22
Message-ID: A737B7A37273E048B164557ADEF4A58B17C523A0@ntex2010i.host.magwien.gv.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Scott Ribe 2013-10-25 13:37:38 Re: testing database consistency
Previous Message metsarin 2013-10-25 08:48:29 failover and switchover in postgresql