1

So I had PostgreSQL working in Ubuntu 11.04 using 8.4(?), however, when I upgraded it also upgraded PostgreSQL to 9.1 and now I can't connect using JDBC.

I added the following to my pg_hba.conf

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

and the following to my postgres.conf...

listen_addresses = '*'

but I get the following connecting with SQuirrel

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

Any ideas?

3
  • 2
    This question is a better fit for superuser.com or serverfault.com or askubuntu.com Commented Oct 17, 2011 at 17:13
  • Sounds like your server is not started. Can you connect using psql? Commented Oct 17, 2011 at 17:15
  • Yes I can connect using sudo -u postgres psql Commented Oct 17, 2011 at 17:27

2 Answers 2

2

Per this site the default port is 5432, however, per the postgres.conf file that came installed by default the port is set to 5433...

port = 5433

So if someone else has this problem try the new port.

I think it has to do with the install incrementing the port when it sees the existing 8.4

Sign up to request clarification or add additional context in comments.

Comments

0

Perhaps a IPv4 vs IPv6 issue? Try adding this line

host    all         all         ::1/128               trust

and try connecting to the hostname localhost.

If that's not a solution, please try md5 instead of trust and give the connecting user a password. Just to be sure to rule this out.

2 Comments

host all all ::1/128 md5 already exists in the file. I tried making it trust, and I also tried making the other one md5 no dice, thanks though.
Will post in 6 hours (freaking rule!) but here is the answer FYI Per this site the default port is 5432, however, per the postgres.conf file that came installed by default the port is set to 5433... port = 5433 So if someone else has this problem try the new port.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.