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 KAA24446 for postgres-dist; Thu, 4 Nov 1993 10:04:36 -0800
Resent-From: POSTGRES mailing list <postman@postgres.Berkeley.EDU>
Resent-Message-Id: <199311041804.KAA24446@nobozo.CS.Berkeley.EDU>
Sender: owner-postman@postgres.Berkeley.EDU
X-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 KAA24437; Thu, 4 Nov 1993 10:04:35 -0800
Message-Id: <199311041804.KAA24437@nobozo.CS.Berkeley.EDU>
X-Authentication-Warning: nobozo.CS.Berkeley.EDU: Host localhost didn't use HELO protocol
From: aoki@postgres.Berkeley.EDU (Paul M. Aoki)
To: PostGres <postgres@st.nepean.uws.edu.au>
Cc: postgres@postgres.Berkeley.EDU (PostGres Mail Group)
Subject: Re: Detecting no postmaster 
In-reply-to: Your message of Thu, 4 Nov 1993 18:14:21 +1100 (EST) 
	     <199311040714.AA23883@guinevere.st.nepean.uws.edu.au> 
Date: Thu, 04 Nov 93 10:04:35 -0800
X-Sender: aoki@postgres.Berkeley.EDU
Resent-To: postgres-dist@postgres.Berkeley.EDU
X-Mts: smtp
Resent-Date: Thu, 04 Nov 93 10:04:36 -0800
Resent-XMts: smtp

PostGres <postgres@st.nepean.uws.edu.au> writes:
> I am wondering whether there is any way to detect that
> a postmaster is not running on a given host.

look at what the routine src/libpq/fe-pqexec.c:EstablishComm does.
you could also write a half-page of code that does a connect(2) to
the well-known port..
--
  Paul M. Aoki  |  CS Div., Dept. of EECS, UCB  |  aoki@postgres.Berkeley.EDU
                |  Berkeley, CA 94720           |  ...!uunet!ucbvax!aoki
