pg.ddx.io pgsql-admin@postgresql.org mailing list archivehelp / color / mirror / Atom feed
table check 2+ messages / 2 participants [nested] [flat]
* table check @ 2004-05-26 15:14 Jodi Kanter <jkanter@virginia.edu> 2004-05-26 15:51 ` Re: table check Bruno Wolff III <bruno@wolff.to> 0 siblings, 1 reply; 2+ messages in thread From: Jodi Kanter @ 2004-05-26 15:14 UTC (permalink / raw) To: pgsql-admin 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 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? Thank you, Jodi -- /_______________________________ //Jodi L Kanter BioInformatics Database Administrator University of Virginia (434) 924-2846 jkanter@virginia.edu <mailto:jkanter@virginia.edu>/ / / / / ^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: table check 2004-05-26 15:14 table check Jodi Kanter <jkanter@virginia.edu> @ 2004-05-26 15:51 ` Bruno Wolff III <bruno@wolff.to> 0 siblings, 0 replies; 2+ messages in thread From: Bruno Wolff III @ 2004-05-26 15:51 UTC (permalink / raw) To: Jodi Kanter <jkanter@virginia.edu>; +Cc: 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. ^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2004-05-26 15:51 UTC | newest] Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2004-05-26 15:14 table check Jodi Kanter <jkanter@virginia.edu> 2004-05-26 15:51 ` Bruno Wolff III <bruno@wolff.to>
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