[SCRIPT] pgrefchk -- checks referential integrity of foreign keys on tables - Mailing list pgsql-hackers

From David D. Kilzer
Subject [SCRIPT] pgrefchk -- checks referential integrity of foreign keys on tables
Date
Msg-id 20020911111406.B15056@elbonia.lubricants-oil.com
Whole thread Raw
List pgsql-hackers
Attached is a perl script called 'pgrefchk'.  It checks the referential
integrity of foreign keys on tables in a PostgreSQL database using the
PG_TABLES, PG_PROC, PG_CLASS and PG_TRIGGER system "tables".

It was created in the same vein as the pguniqchk script which checks the
uniqueness of unique constraints on tables in a PostgreSQL database.

Why would this be useful?

If you're planning to dump and restore the database, or if you suspect
the state of data in your database after having hard drive issues, this
might be a good sanity check to run.

If nothing else, it's a good example of how to query PostgreSQL system
tables.

NOTES:

- Only tested on PostgreSQL 7.1.3.

Dave

Attachment

pgsql-hackers by date:

Previous
From: Rod Taylor
Date:
Subject: Re: beta1 packaged
Next
From: Guido Goldstein
Date:
Subject: Re: Script to compute random page cost