Subject: Unable to connect to backend

From: [email-masked] (Doug Ito)
Date: Sat, 23 Nov 91 16:46:50 PST

I'm unable to connect to the postgres backend even after
restarting the postmaster. I get the following message:

-----------------
* retrieve (TODAY.all) \g

Query sent to backend is "retrieve (TODAY.all) "
Error: Failed to connect to backend (host=localhost, port=4321)
-----------------

When I run the postgres backend itself, I'm able to
connect to it.

Any suggestions?
Thanks,

Doug Ito

---

From: postarch (Postgres Mailing Archive)
Date: Mon, 02 Dec 91 13:02:54 PST

> restarting the postmaster. I get the following message:

It looks as though the postmaster and monitor are using different
ports... Did you use the -p <port #> option to the postmaster when you
started it?  If so you should either use -p <port #> when running the
monitor or set PGPORT in your environment to the corresponding port #
you used for the postmaster.

Another possibility:  are the postmaster and monitor running on the same
machine?  If not use the -h <hostname> option to the monitor so that it 
knows what machine the postmaster is running on.

Where there any problems in starting the postmaster?  If you still can't
connect you should make sure it is still running:

	ps axu | grep postmaster

Running the postgres back standalone does not go through the postmaster
at all.  Only when you run a libpq application (e.g. the monitor) is an 
initial connection to the postmaster needed.  The postmaster will fork a 
copy of the POSTGRES backend and then set up the front-end/back-end socket 
communication.  (Running standalone also means that you have your own private 
copy of shared memory and semaphores and therefore POSTGRES cannot safeguard 
your database in the case of concurrent access by you and other potential
users.)