First off, I'm new to Vagrant and Postgres.
I created my Vagrant instance using http://files.vagrantup.com/lucid32.box without any trouble. I am able to run vagrant up
and vagrant ssh
without issue.
I followed the instructions with one minor alteration, I installed the "postgresql-8.4-postgis" package instead of "postgresql postgresql-contrib".
I started the server using:
postgres@lucid32:/home/vagrant$ /etc/init.d/postgresql-8.4 start
While connected to the vagrant instance I can use psql
to connect to the instance without issue.
In my Vagrantfile I had already added:
config.vm.forward_port 5432, 5432
but when I try to run psql from the localhost I get:
psql: could not connect to server: Connection refused
Is the server running locally and accepting
connections on Unix domain socket "/tmp/.s.PGSQL.5432"?
I'm sure I am missing something simple. Any ideas?
Update:
I found a reference to an issue like this and the article suggested using:
psql -U postgres -h localhost
with that I get:
psql: server closed the connection unexpectedly
This probably means the server terminated abnormally
before or while processing the request.