Skip site navigation (1) Skip section navigation (2)

Re: verifying database integrity - fsck for pg?

From: Guido Neitzer <guido(dot)neitzer(at)pharmaline(dot)de>
To: PostgreSQL General <pgsql-general(at)postgresql(dot)org>
Subject: Re: verifying database integrity - fsck for pg?
Date: 2006-01-31 15:19:35
Message-ID: B2614B29-FD1D-4990-B2BA-8411BF221EA3@pharmaline.de (view raw or flat)
Thread:
Lists: 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


In response to

Responses

pgsql-general by date

Next:From: Richard HuxtonDate: 2006-01-31 15:20:34
Subject: Re: How to define variables in psql scripts?
Previous:From: Bricklen AndersonDate: 2006-01-31 15:10:50
Subject: Re: New project launched : PostgreSQL GUI Installer for

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group