Can’t connect to local PostgresSQL server I have the Postres app installed an running on my Mac. And it has worked beautifully. I don’t know what changed, but now I cannot connect to it from Rails, PG Commander, PG Admin or the command psql -h localhost. However, I can connect with just psql. I get the following error in the log as soon as the connection times out:

LOG:  incomplete startup packet


Rails database.yml

development:
  adapter: postgresql
  database: my_db
  host: localhost


PG Commander settings:



pg_hba.conf:

# "local" is for Unix domain socket connections only
local   all             all                                     trust
# IPv4 local connections:
host    all             all             127.0.0.1/32            trust
# IPv6 local connections:
host    all             all             ::1/128                 trust


postgresql.conf: https://gist.github.com/davbeck/49a23a48fa161b3e06fc#file-gistfile1-txt
Since your local psql session just works, your database is OK. Your other sessions try to connect using network. Things to check here are the listen_addresses and port parameters to be found in your postgres.conf They must match with what the clients specify.
Next to that, your firewalls must allow the access. For your local firewall check your settings Security and Privacy settings. There is a good chance that there is a question asking to allow your postmaster to connect to the network.