From: Bruno Wolff III <bruno@wolff.to>
To: Jodi Kanter <jkanter@virginia.edu>
Cc: Postgres Admin List <pgsql-admin@postgresql.org>
Subject: Re: table check
Date: Wed, 26 May 2004 10:51:48 -0500
Message-ID: <20040526155148.GA2484@wolff.to> (raw)
In-Reply-To: <40B4B438.2060900@virginia.edu>
References: <40B4B438.2060900@virginia.edu>
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.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-admin@postgresql.org
Cc: bruno@wolff.to, jkanter@virginia.edu
Subject: Re: table check
In-Reply-To: <20040526155148.GA2484@wolff.to>
References: <40B4B438.2060900@virginia.edu> <20040526155148.GA2484@wolff.to>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox