Does PG have a database

Поиск
Список
Период
Сортировка
От Mark Fenbers
Тема Does PG have a database
Дата
Msg-id 4471E6B9.9080002@noaa.gov
обсуждение исходный текст
Ответы Re: Does PG have a database  (Markus Schaber <schabi@logix-tt.com>)
Re: Does PG have a database  (Manlio Perillo <manlio_perillo@libero.it>)
Re: Does PG have a database  (Achilleus Mantzios <achill@matrix.gatewaynet.com>)
Список pgsql-sql
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


В списке pgsql-sql по дате отправления:

Предыдущее
От: Patrick JACQUOT
Дата:
Сообщение: Re: insert related data into two tables
Следующее
От: Markus Schaber
Дата:
Сообщение: Re: Does PG have a database