X-Original-To: pgsql-admin-postgresql.org@postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 0A7739FB1C6 for ; Thu, 27 Jul 2006 05:24:28 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 72866-01 for ; Thu, 27 Jul 2006 05:24:23 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey- Received: from py-out-1112.google.com (py-out-1112.google.com [64.233.166.176]) by postgresql.org (Postfix) with ESMTP id B918E9FB1C0 for ; Thu, 27 Jul 2006 05:23:53 -0300 (ADT) Received: by py-out-1112.google.com with SMTP id b36so125156pyb for ; Thu, 27 Jul 2006 01:23:52 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=MdaiQiE4gEqANaKK70Wr3C8e4550e2wPizQ5MEEQlNE/CBxaYwhhY/N2+ajIh1HC4hnhXx55RmhqGaNiuyUeslQ/BBijqqxNQNFWFcBRc34DnQ0xmYUGMuEkycOBuGG5paN2Qny08KwXhBCQknff0vv/4OGXraacHnWYYJn/XEQ= Received: by 10.35.26.14 with SMTP id d14mr12775110pyj; Thu, 27 Jul 2006 01:23:52 -0700 (PDT) Received: by 10.35.61.12 with HTTP; Thu, 27 Jul 2006 01:23:52 -0700 (PDT) Message-ID: Date: Thu, 27 Jul 2006 13:23:52 +0500 From: "Shoaib Mir" To: pgsql-admin@postgresql.org Subject: Re: Connection refused. Check that the hostname and port are correct In-Reply-To: <44BF2E4F.7090200@internode.com.au> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_153058_18311491.1153988632444" References: <44BF2E4F.7090200@internode.com.au> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.672 tagged_above=0 required=5 tests=AWL, DNS_FROM_RFC_ABUSE, HTML_40_50, HTML_MESSAGE, NORMAL_HTTP_TO_IP, SPF_PASS X-Spam-Level: X-Archive-Number: 200607/236 X-Sequence-Number: 22482 ------=_Part_153058_18311491.1153988632444 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline That appears to be the JDBC driver is not able to connect to the PostgreSQL database. Try out the following: - See if there is any firewall running, run 'iptables -F" on the database server machine to disable it for a while and then test the same Java code - Check the routing tables info and see if there is anything missing there. - If the above two are okay and still its not connecting try out settng the following in your pg_hba.conf file: host all all 127.0.0.1/32 trust host all all 0.0.0.0/0 trust and then do a 'pg_ctl reload' and see if that now lets you connect through the JDBC driver or not locally and over the lan. Thanks, -- Shoaib Mir EnterpriseDB (www.enterprisedb.com) On 7/20/06, Omer Mustafa wrote: > > Hi, > > I am new to PostgreSQL. I am trying to connect to my PostgreSQL database > installed on Unix. I am getting the following error message, > > > *************************************************************************** > An error occured while establishing the connection. > Type: org.postgresql.util.PSQLException Error Code: 0 SQL State: > 08004 > Message: > Connection refused. Check that the hostname and port are correct and > that the postmaster is accepting TCP/IP connections. > Exception: java.net.ConnectException: Connection refused: connect > > *************************************************************************** > > I have checked port number, user name, password and they are all > correct. I have also checked that the postmaster is also running. > > ******************************* > postgres 25398 25344 0 11:57:51 pts/2 0:00 psql syslog > postgres 25548 25546 0 16:01:35 pts/3 0:00 > /usr/local/pgsql/bin/postmaster > postgres 25613 25580 0 16:43:01 pts/3 0:00 grep post > postgres 25344 25301 0 10:57:05 pts/2 0:00 -tcsh > postgres 25546 1 0 16:01:35 pts/3 0:00 > /usr/local/pgsql/bin/postmaster > postgres 25550 25549 0 16:01:35 pts/3 0:00 > /usr/local/pgsql/bin/postmaster > postgres 25549 25546 0 16:01:35 pts/3 0:00 > /usr/local/pgsql/bin/postmaster > postgres 25580 25443 0 16:34:17 pts/3 0:00 -tcsh > ******************************* > > I have the following settings in my configuration file > > ****************** > host syslog sysloguser 10.10.10.10/32 trust > host syslog sysloguser 192.168.0.0/32 trust > ***************** > > Please advice what am I doing wrong > > -- > > Thanks and Regards > Omer Mustafa > Oracle Application DBA > omustafa@internode.com.au > Internode, Level 1, 132 Grenfell Street > ADELAIDE SA 5000 > Ph: 08 8228 2379 > Mobile # 0421 038839 > > ---------------------------(end of broadcast)--------------------------- > TIP 5: don't forget to increase your free space map settings > ------=_Part_153058_18311491.1153988632444 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline That appears to be the JDBC driver is not able to connect to the PostgreSQL database.

Try out the following:

- See if there is any firewall running, run 'iptables -F" on the database server machine to disable it for a while and then test the same Java code
- Check the routing tables info and see if there is anything missing there.
- If the above two are okay and still its not connecting try out settng the following in your pg_hba.conf file:

host    all         all         127.0.0.1/32          trust
host    all         all         0.0.0.0/0         trust

and then do a 'pg_ctl reload' and see if that now lets you connect through the JDBC driver or not locally and over the lan.

Thanks,

--
Shoaib Mir
EnterpriseDB (www.enterprisedb.com)

On 7/20/06, Omer Mustafa < omustafa@internode.com.au> wrote:
Hi,

I am new to PostgreSQL. I am trying to connect to my PostgreSQL database
installed on Unix. I am getting the following error message,

***************************************************************************
An error occured while establishing the connection.
    Type: org.postgresql.util.PSQLException   Error Code: 0   SQL State:
08004
Message:
    Connection refused. Check that the hostname and port are correct and
that the postmaster is accepting TCP/IP connections.
Exception: java.net.ConnectException: Connection refused: connect
***************************************************************************

I have checked port number, user name, password and they are all
correct. I have also checked that the postmaster is also running.

*******************************
postgres 25398 25344   0 11:57:51 pts/2       0:00 psql syslog
postgres 25548 25546   0 16:01:35 pts/3       0:00
/usr/local/pgsql/bin/postmaster
postgres 25613 25580   0 16:43:01 pts/3       0:00 grep post
postgres 25344 25301   0 10:57:05 pts/2       0:00 -tcsh
postgres 25546     1   0 16:01:35 pts/3       0:00
/usr/local/pgsql/bin/postmaster
postgres 25550 25549   0 16:01:35 pts/3       0:00
/usr/local/pgsql/bin/postmaster
postgres 25549 25546   0 16:01:35 pts/3       0:00
/usr/local/pgsql/bin/postmaster
postgres 25580 25443   0 16:34:17 pts/3       0:00 -tcsh
*******************************

I have the following settings in my configuration file

******************
host    syslog      sysloguser  10.10.10.10/32        trust
host    syslog      sysloguser  192.168.0.0/32        trust
*****************

Please advice what am I doing wrong

--

Thanks and Regards
Omer Mustafa
Oracle Application DBA
omustafa@internode.com.au
Internode, Level 1, 132 Grenfell Street
ADELAIDE SA 5000
Ph:    08 8228 2379
Mobile # 0421 038839

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings




------=_Part_153058_18311491.1153988632444--