connection error

Started by Sonam Sharmaover 7 years ago4 messagesgeneral
Jump to latest
#1Sonam Sharma
sonams1209@gmail.com

getting below error from application side :
========

Last acquisition attempt exception:

org.postgresql.util.PSQLException: Connection refused. Check that the
hostname and port are correct and that the postmaster is accepting TCP/IP
connections.

the port no is set correct :

[postgres@lxsqlptgsdev004 data]$ psql -h localhost -p 5432

psql (9.5.14)

Type "help" for help.

postgres=#

In pg_hba.conf also:

# IPv4 local connections:

host all all 127.0.0.1/32 trust

host all all 127.0.0.1/23 trust

host all all 172.29.161.53/23 trust

host all all 172.29.161.52/23 trust

Can someone please help what can be done to resolve this.

Thanks,

Sonam

#2Amul Sul
sulamul@gmail.com
In reply to: Sonam Sharma (#1)
Re: connection error

Do you have following entry as well?

# IPv6 local connections:
host all all ::1/128 trust

I hope "listen_addresses " in postgresql.conf is on default setting.

Regards,
Amul Sul

Show quoted text

On Fri, Sep 7, 2018 at 4:08 PM Sonam Sharma <sonams1209@gmail.com> wrote:

getting below error from application side :
========

Last acquisition attempt exception:

org.postgresql.util.PSQLException: Connection refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.

the port no is set correct :

[postgres@lxsqlptgsdev004 data]$ psql -h localhost -p 5432

psql (9.5.14)

Type "help" for help.

postgres=#

In pg_hba.conf also:

# IPv4 local connections:

host all all 127.0.0.1/32 trust

host all all 127.0.0.1/23 trust

host all all 172.29.161.53/23 trust

host all all 172.29.161.52/23 trust

Can someone please help what can be done to resolve this.

Thanks,

Sonam

#3Amul Sul
sulamul@gmail.com
In reply to: Amul Sul (#2)
Re: connection error

On Fri, Sep 7, 2018 at 5:10 PM amul sul <sulamul@gmail.com> wrote:

Do you have following entry as well?

# IPv6 local connections:
host all all ::1/128 trust

I hope "listen_addresses " in postgresql.conf is on default setting.

Sorry, I misread -- your local psql connection is fine .

Try setting listen_addresses = '*' in postgresql.conf.

For more detail please have a look to
https://www.postgresql.org/docs/9.5/static/runtime-config-connection.html

Regards,
Amul Sul

#4Ahmed, Nawaz
Nawaz@fast.au.fujitsu.com
In reply to: Sonam Sharma (#1)
RE: connection error

Hi,

Are you sure it is /23 and not /32 for the CIDR notation ?

host all all 127.0.0.1/32<http://127.0.0.1/32&gt; trust
host all all 127.0.0.1/23<http://127.0.0.1/23&gt; trust
host all all 172.29.161.53/23<http://172.29.161.53/23&gt; trust
host all all 172.29.161.52/23<http://172.29.161.52/23&gt; trust

Best Regards,

Nawaz Ahmed
Software Development Engineer

Fujitsu Australia Software Technology Pty Ltd
14 Rodborough Road, Frenchs Forest NSW 2086, Australia
T +61 2 9452 9027
Nawaz@fast.au.fujitsu.com<mailto:Nawaz@fast.au.fujitsu.com>
fastware.com.au<http://fastware.com.au/&gt;

[cid:image001.jpg@01D44911.4DB77F50]
[cid:image002.jpg@01D44911.4DB77F50]

From: Sonam Sharma [mailto:sonams1209@gmail.com]
Sent: Friday, 7 September 2018 8:38 PM
To: pgsql-general@postgresql.org
Subject: connection error

getting below error from application side :
========
Last acquisition attempt exception:
org.postgresql.util.PSQLException: Connection refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.

the port no is set correct :
[postgres@lxsqlptgsdev004 data]$ psql -h localhost -p 5432
psql (9.5.14)
Type "help" for help.

postgres=#
In pg_hba.conf also:

# IPv4 local connections:
host all all 127.0.0.1/32<http://127.0.0.1/32&gt; trust
host all all 127.0.0.1/23<http://127.0.0.1/23&gt; trust
host all all 172.29.161.53/23<http://172.29.161.53/23&gt; trust
host all all 172.29.161.52/23<http://172.29.161.52/23&gt; trust

Can someone please help what can be done to resolve this.

Thanks,
Sonam
Disclaimer

The information in this e-mail is confidential and may contain content that is subject to copyright and/or is commercial-in-confidence and is intended only for the use of the above named addressee. If you are not the intended recipient, you are hereby notified that dissemination, copying or use of the information is strictly prohibited. If you have received this e-mail in error, please telephone Fujitsu Australia Software Technology Pty Ltd on + 61 2 9452 9000 or by reply e-mail to the sender and delete the document and all copies thereof.

Whereas Fujitsu Australia Software Technology Pty Ltd would not knowingly transmit a virus within an email communication, it is the receiver’s responsibility to scan all communication and any files attached for computer viruses and other defects. Fujitsu Australia Software Technology Pty Ltd does not accept liability for any loss or damage (whether direct, indirect, consequential or economic) however caused, and whether by negligence or otherwise, which may result directly or indirectly from this communication or any files attached.

If you do not wish to receive commercial and/or marketing email messages from Fujitsu Australia Software Technology Pty Ltd, please email unsubscribe@fast.au.fujitsu.com

Attachments:

image001.jpgimage/jpeg; name=image001.jpgDownload
image002.jpgimage/jpeg; name=image002.jpgDownload