Re: How to determine a database is intact?

Wes <wespvp@syntegra.com>

From: Wes Palmer <wespvp@syntegra.com>
To: Richard Huxton <dev@archonet.com>
Cc: Postgres General <pgsql-general@postgresql.org>
Date: 2004-09-04T04:01:40Z
Lists: pgsql-general
On 9/3/04 10:14 AM, "Richard Huxton" <dev@archonet.com> wrote:

> Put bluntly, you can't. The only way to verify the database as a whole
> is to check every single value in it. If actual values get corrupted
> then you may never even notice (e.g. a text field with a single
> character corrupted).
> However, if you dump and restore then three things can be guaranteed:
> 1. All values are valid for their type
> 2. All indexes are rebuilt
> 3. Constraints will be satisfied on all data.
> Is that good enough in your case?

No, a dump/reload isn't feasible.  Right now, it takes about 24 hours to do
the actual pg_dumpall and reload.  When the database peaks in size and
records start being aged out, multiply that by 4 (at least).  Obviously,
this isn't a check you can do weekly.

I was hoping there might be a utility to scan the entire database for
consistency (something akin to running ANALYZE FULL).  Obviously, that would
require accessing every row and every index value.

Wes