Re: table check - Mailing list pgsql-admin

From Bruno Wolff III
Subject Re: table check
Date
Msg-id 20040526155148.GA2484@wolff.to
Whole thread Raw
In response to table check  (Jodi Kanter <jkanter@virginia.edu>)
List pgsql-admin
On Wed, May 26, 2004 at 11:14:00 -0400,
  Jodi Kanter <jkanter@virginia.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.

pgsql-admin by date:

Previous
From: jseymour@linxnet.com (Jim Seymour)
Date:
Subject: Re: pg_hba.conf
Next
From: Chris Browne
Date:
Subject: Re: pg_hba.conf