Re: Can not connect remotely

Lists: pgsql-general
From: arya6000 <arya6000(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Can not connect remotely
Date: 2010-04-09 17:08:38
Message-ID: 28195027.post@talk.nabble.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general


Hello

I have spent hours trying to make this work, but its still not working. I
tried to connect using my Java program and using pgAdmin III. Postgre is
hosted on a Debian 5 64 bit vps and here are the changes I made.

I edited postgresql.conf
and changed

listen_addresses = 'local'

to

listen_addresses = '*'

After that I edited pg_hba.conf and added the following line at the end of
the file

host all all 0.0.0.0/0 md5

and I restarted postgresql by using

Quote:
/etc/init.d/postgresql-8.3 restart

but I always get the following error

Connection refused. Check that the hostname and port are correct and that
the postmaster is accepting TCP/IP connections.

Any idea how I can fix my problem?

Best Regards!
--
View this message in context: http://old.nabble.com/Can-not-connect-remotely-tp28195027p28195027.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.


From: Scott Mead <scott(dot)lists(at)enterprisedb(dot)com>
To: arya6000 <arya6000(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Can not connect remotely
Date: 2010-04-09 17:18:10
Message-ID: p2yd3ab2ec81004091018mf7478227gdd536aee19bfb075@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

On Fri, Apr 9, 2010 at 1:08 PM, arya6000 <arya6000(at)gmail(dot)com> wrote:

>
> Hello
>
> I have spent hours trying to make this work, but its still not working. I
> tried to connect using my Java program and using pgAdmin III. Postgre is
> hosted on a Debian 5 64 bit vps and here are the changes I made.
>
> I edited postgresql.conf
> and changed
>
> listen_addresses = 'local'
>
> to
>
> listen_addresses = '*'
>
>
>
> After that I edited pg_hba.conf and added the following line at the end of
> the file
>
> host all all 0.0.0.0/0 md5
>
>
> and I restarted postgresql by using
>
> Quote:
> /etc/init.d/postgresql-8.3 restart
>
>
> but I always get the following error
>
> Connection refused. Check that the hostname and port are correct and that
> the postmaster is accepting TCP/IP connections.
>
> Any idea how I can fix my problem?
>
>
Do you have a firewall running?

--Scott

> Best Regards!
> --
> View this message in context:
> http://old.nabble.com/Can-not-connect-remotely-tp28195027p28195027.html
> Sent from the PostgreSQL - general mailing list archive at Nabble.com.
>
>
> --
> Sent via pgsql-general mailing list (pgsql-general(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general
>


From: Rodrigo Gonzalez <rjgonzale(at)estrads(dot)com(dot)ar>
To: arya6000 <arya6000(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Can not connect remotely
Date: 2010-04-09 17:20:04
Message-ID: 20100409142004.0930b5c5@estrads.com.ar
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

On Fri, 9 Apr 2010 10:08:38 -0700 (PDT)
arya6000 <arya6000(at)gmail(dot)com> wrote:

>
>
> Connection refused. Check that the hostname and port are correct and
> that the postmaster is accepting TCP/IP connections.
>

Are you sure that your firewall is allowing connections to port
5432/tcp?

Best regards

Rodrigo Gonzalez


From: Sam Mason <sam(at)samason(dot)me(dot)uk>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Can not connect remotely
Date: 2010-04-09 21:03:19
Message-ID: 20100409210319.GT5407@samason.me.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

On Fri, Apr 09, 2010 at 10:08:38AM -0700, arya6000 wrote:
> Connection refused. Check that the hostname and port are correct and that
> the postmaster is accepting TCP/IP connections.

Running the following on your server:

netstat -tnl

will tell you if PG is actually listening on the port you expect. If
it's there as expected, then you need to look at your firewall/VPS
config to see whether the traffic is making its way through correctly.

--
Sam http://samason.me.uk/