I have installed PostgreSQL 9.1 on ubuntu 12.04 64-bit. I try to run Aplication Stack Builder and install pgAgent.
At first I am asked for root password, which I provide, after I choose PostgreSQL 9.1 on port 5433 as the only option. On next screen I tick pgAgent and click Next a few times to get to the Setup screen with verification the postgradeSQL installation details. The Host is local, the User Name is postgres and I type my password for postgrade which I use when open pgAdmin III. When I click next I have a warning:
psql.bin: could not connect to server: Connection refused Is the server running on host "localhost" (127.0.0.1) and accepting TCP/IP connection on port 5432?
When I try pgAdmin it does work with password I provide but it looks for me like this password is not accepted by Stack Builder. I also provide my admin password on the begining so it should be able to do everything with sudo privilage. I don’t know what to do now and what is the problem. Should I run something else before Stack Builder?
Default postgres port number is 5432. You state in the beginning that your server runs on 5433, but error message shows that it cannot connect to localhost:5432.
Typically, the only situation when 5433 is chosen automatically is when you install say PostgreSQL 9.1 when some previous version (8.4 or 9.0) was installed and running.
To fix your problem, you may want to remove old installation and make sure that one that you need is listening on port 5432.
In addition to that, by default PostgreSQL may not listen on network at all – you may need to adjust postgresql.conf to have this option: