Return-Path: owner-postman
Received: from localhost (localhost [127.0.0.1]) by nobozo.CS.Berkeley.EDU (8.6.3/8.6.3) with SMTP id XAA21146 for postgres-dist; Wed, 3 Nov 1993 23:14:31 -0800
Resent-From: POSTGRES mailing list <postman@postgres.Berkeley.EDU>
Resent-Message-Id: <199311040714.XAA21146@nobozo.CS.Berkeley.EDU>
X-Authentication-Warning: nobozo.CS.Berkeley.EDU: Host localhost didn't use HELO protocol
Sender: owner-postman@postgres.Berkeley.EDU
X-Return-Path: owner-postman
Received: from lancelot.st.nepean.uws.edu.au (root@lancelot.st.nepean.uws.EDU.AU [137.154.148.30]) by nobozo.CS.Berkeley.EDU (8.6.3/8.6.3) with SMTP id XAA21137 for <postgres@nobozo.CS.Berkeley.EDU>; Wed, 3 Nov 1993 23:14:28 -0800
Received: from guinevere.st.nepean.uws.edu.au (guinevere) by lancelot.st.nepean.uws.edu.au with SMTP id AA25449
  (5.65c/IDA-1.4.4 for <postgres@nobozo.CS.Berkeley.EDU>); Thu, 4 Nov 1993 18:16:11 +1100
Received: by guinevere.st.nepean.uws.edu.au id AA23883
  (5.65c/IDA-1.4.4 for postgres@postgres.berkeley.edu); Thu, 4 Nov 1993 18:14:22 +1100
From: PostGres <postgres@st.nepean.uws.edu.au>
Message-Id: <199311040714.AA23883@guinevere.st.nepean.uws.edu.au>
Subject: Detecting no postmaster
To: postgres@postgres.Berkeley.EDU (PostGres Mail Group)
Date: Thu, 4 Nov 1993 18:14:21 +1100 (EST)
X-Mailer: ELM [version 2.4 PL23]
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Content-Length: 1410      
Resent-To: postgres-dist@postgres.Berkeley.EDU
Resent-Date: Wed, 03 Nov 93 23:14:31 -0800
Resent-XMts: smtp

Dear gurus,

I am wondering whether there is any way to detect that
a postmaster is not running on a given host.

What I am trying to do is change from on postmaster to
another postmaster during the execution of the program.

The code is like the following :
(the name of the new host is retrieved from the db)

strcpy(PQhost, PQgetvalue(PQparray("blank"),0,0));
PQsetdb("remote");

to change postmasters and databases, then I thought I
might be able to tramsmit a bogus query and capture
the return to see if the postmaster exists.

If the postmaster on the remote machine is not running
the code terminates with :

StreamOpen: connect: errno=61
Error: Failed to connect to backend (host=tron, port=4321)
Is the postmaster running?

I would like to capture this and display something more
like :

Server on host "tron" is not responding !

Thanx for any advice that you can give,
Glen Darby.
-- 
--------------------------------------------------------
| University Of Western Sydney                         |
| Postgres Database Aministration                      |
|                                                      |
| Administrator :  Glen Darby                          |
|                                                      |
|                                                      |
| Return Mail : postgres@st.nepean.uws.edu.au          |
========================================================
