From: | Bruno Wolff III <bruno(at)wolff(dot)to> |
---|---|
To: | Jodi Kanter <jkanter(at)virginia(dot)edu> |
Cc: | Postgres Admin List <pgsql-admin(at)postgresql(dot)org> |
Subject: | Re: table check |
Date: | 2004-05-26 15:51:48 |
Message-ID: | 20040526155148.GA2484@wolff.to |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-admin |
On Wed, May 26, 2004 at 11:14:00 -0400,
Jodi Kanter <jkanter(at)virginia(dot)edu> wrote:
> We are working on checking to see whether a database has been created
> from a Perl/Pg interface. Is there an easy way to count tables such
You should be checking the return code when creating each object and
the commit for the transaction. If these indeicate success then the
objects were created.
> that if the count comes back at zero the script knows that the database
> has not yet been created?
> We tried simply using \d but cannot get that to work. I would assume
> there is some system table that must list the tables when there are some??
> thoughts?
\d is a psql command that isn't available in the perl interfaces. You
can either query the informatation schema or use the -E option on psql
to see what queries to use on the version of Postgres you are running
to retrieve that information.
From | Date | Subject | |
---|---|---|---|
Next Message | Chris Browne | 2004-05-26 19:02:52 | Re: pg_hba.conf |
Previous Message | Jim Seymour | 2004-05-26 15:34:32 | Re: pg_hba.conf |