I have a postgresql server inside a virtualbox created by vagrant.
I have also set up a portforwarding from 5432 inside the box to 15432 on the host system via the Vagrant file.
When connecting via psql
$ psql dbname username -h 127.0.0.1 -p 15432
psql: server closed the connection unexpectedly
This probably means the server terminated abnormally
before or while processing the request.
Both, server and client are running Ubuntu 12.04 (postgresql-9.1, Version: 9.1+129ubuntu1)
Connecting inside the VM it self to port 5432 works fine.
The port forwarding it self does not seem to go completely wrong, because when I try to another port, I get "connection refused")