Skip site navigation (1) Skip section navigation (2)

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search for
  Advanced Search

Does PG have a database



I have working PostgreSQL databases on 3 of my ~30 Linux boxes. I want my software to be able to determine which of my 30 boxes have functional databases on them. Since Pg is part of the baseline distro, merely checking for the existence of an executable doesn't solve my problem.

I tried looping through my list of hosts and running the command:
   psql -h $host --list
but this fails on a box with a database with the same error code as on a box that doesn't have a database, if my PGUSER isn't set and my login ID is not the username of the database. The PGUSER setting might differ for each host, so specifying this in the software is not practical.

Bottom line: What trick can I use to determine whether a box has a living, breathing Pg database if I don't know the DB owner?
Mark



Home | Main Index | Thread Index

Privacy Policy | PostgreSQL Archives hosted by Command Prompt, Inc. | Designed by tinysofa
Copyright © 1996 – 2008 PostgreSQL Global Development Group