Re: check if database is correctly created - Mailing list pgsql-general

From Tom Lane
Subject Re: check if database is correctly created
Date
Msg-id 5574.1187191321@sss.pgh.pa.us
Whole thread Raw
In response to check if database is correctly created  ("Alain Roger" <raf.news@gmail.com>)
List pgsql-general
"Alain Roger" <raf.news@gmail.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

pgsql-general by date:

Previous
From: "Phoenix Kiula"
Date:
Subject: Re: Yet Another COUNT(*)...WHERE...question
Next
From: "Phoenix Kiula"
Date:
Subject: Customizing psql console to show execution times