Re: starting postmaster W2K service

From: Frank Seesink <frank(at)mail(dot)wvnet(dot)edu>
To: pgsql-cygwin(at)postgresql(dot)org
Subject: Re: starting postmaster W2K service
Date: 2003-10-28 03:54:14
Message-ID: bnkp9c$rah$1@sea.gmane.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-cygwin

...
>>But the server does start when I open the Postgres program (Start ->
>>Programs -> PostgreSQL -> Utilities -> Start PostgreSQL Server), and I
>>can create Databases. But when I try to connect remotely to the
>>Database using PgAdmin it gives an error message saying "Error
>>connecting to the server. Is the server running on host ....".
>>
>>what does this mean? What do you suggest I must do?
>
> Sorry, but I have never used PgAdmin before.
>
> Jason

Akhona,

In short, the error message you are seeing is very much like what you
would get if you tried using 'psql' from the Cygwin command line, such as

____________________________________________________________

[Connecting from psql to PostgreSQL via internal sockets]
$ psql template1
psql: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/tmp/.s.PGSQL.5432"?

[Connecting from psql to PostgreSQL via TCP/IP ports]
$ psql -h localhost template1
psql: could not connect to server: Connection refused
Is the server running on host localhost and accepting
TCP/IP connections on port 5432?
____________________________________________________________

The error message indicates that pgAdmin does not "see" your PostgreSQL
server sitting on TCP port 5432 (assuming defaults). As noted with
psql's error messages above, the question asked is pretty
straightforward. In short, "I can't see PostgreSQL. Are you sure it's
running?"

As pgAdmin connects via TCP/IP and NOT via internal sockets, it's
important that you have your PostgreSQL configured to listen via TCP/IP
(which, by default, it is not). Specificically, look at

/usr/share/postgresql/data/pg_hba.conf
/usr/share/postgresql/data/postgresql.conf

(again, assuming you have followed the README and used default
directories). These files are self-explanatory with excellent comments.
Just read them and make the appropriate adjustments to make sure
PostgreSQL is listening via TCP/IP. Then pgAdmin should work fine.

NOTE: For basic TCP/IP connectivity, only one line needs to be changed
in each file. But I think it's in your best interest to understand what
those files are doing for you. Be aware that having PostgreSQL
listening via TCP/IP (one line in postgresql.conf) "opens up" your
database to possible attack from the Net, so it's important to
understand how to allow ONLY those users and/or IP addresses that should
have access (set in pg_hba.conf). My test setup is set to only allow
access from the localhost/loopback address, 127.0.0.1. Your situation
may require something different.

By the way, what version of pgAdmin are you using? The latest version
as I write this is pgAdmin III v1.0.0, which I have installed and
running. If you are running either an older beta of pgAdmin III or some
version of pgAdmin II, be sure to look into this release. Details here:

http://pgadmin.postgresql.org/pgadmin3/

P.S. Jason, when it comes to pgAdmin, I suspect you already know it's
a free, open-source GUI front-end/client for PostgreSQL. Just
note that it requires a TCP/IP hook into PostgreSQL. It does
not support connection via sockets. So odds are the most common
problem will be users not configuring PostgreSQL for TCP/IP.

In response to

Browse pgsql-cygwin by date

  From Date Subject
Next Message Frank Seesink 2003-10-28 03:59:36 PostgreSQL 7.3.4 SSL support
Previous Message Jason Tishler 2003-10-27 19:38:34 Re: Need some help getting started