Re: check if database is correctly created

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Alain Roger" <raf(dot)news(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: check if database is correctly created
Date: 2007-08-15 15:22:01
Message-ID: 5574.1187191321@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"Alain Roger" <raf(dot)news(at)gmail(dot)com> writes:
> i would like to check (via PHP or C#) if my database has been correctly
> created.
> for that i use the following SQL :
> select * from pg_tables where tablename = 'xxx' AND schemaname = 'yyy';
> this i repeat till i check all tables.
> But how to check sequences, index, functions, and so on ?

Instead of re-inventing the wheel, why not run "pg_dump -s" and diff its
output against that from a known good database?

I think there is a more sophisticated "database diff" tool out there,
too ... maybe on pgfoundry.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Phoenix Kiula 2007-08-15 15:22:51 Customizing psql console to show execution times
Previous Message Erik Jones 2007-08-15 15:20:04 Re: is this trigger safe and efective? - locking (caching via triiggers)