Re: verifying database integrity - fsck for pg? - Mailing list pgsql-general

From Guido Neitzer
Subject Re: verifying database integrity - fsck for pg?
Date
Msg-id B2614B29-FD1D-4990-B2BA-8411BF221EA3@pharmaline.de
Whole thread Raw
In response to Re: verifying database integrity - fsck for pg?  (Rich Doughty <rich@opusvl.com>)
Responses Re: verifying database integrity - fsck for pg?
List pgsql-general
On 31.01.2006, at 16:00 Uhr, Rich Doughty wrote:

> i had considered pg_dump. i was hoping there was a utility similar
> to fsck that could check for corruption. i'd like to verify now that
> the data is ok, rather than coming across errors in 6 months time.

I have done this using JDBC (and the WebObjects frameworks) a few
months ago. It wasn't a big problem as I could crawl over the defined
tables (entities) in my database definition file (EOModel) and then
compare row by row. It was slow like hell as it had to go over every
row and over nearly every column, but it wasn't really complicate to
write.

Unfortunately I don't have the code for that anymore as I have
deleted the project by accident (I have made this with one of my test
projects).

But as far as I see, you can do the same with every tool that may
connect to two datasources, can iterate over a result set (rows and
columns) and can compare contents.

Perhaps you have to do some tricks to tell the script which tables or
columns should be equal and which are allowed to differ, but as far
as I can see, it shouldn't be that hard. At all, it took me about a
day to verify the db contents.

cug

--
PharmaLine Essen, GERMANY and
Big Nerd Ranch Europe - PostgreSQL Training, Feb. 2006, Rome, Italy
http://www.bignerdranch.com/classes/postgresql.shtml



Attachment

pgsql-general by date:

Previous
From: Henrique Engelmann
Date:
Subject: Automatic monitoring
Next
From: "Dave Page"
Date:
Subject: Re: Automatic monitoring