How to connect to a Postgres server in a Docker (1.12.0) container on a Mac?
I had the same problem today. I discovered that you do have to specify the -h flag for it to work:

psql -U postgres -p 5433 -h localhost

You can also use the URI style connection string:

psql postgresql://postgres:&lt;your_password&gt;@localhost:5433

The default is "local socket" which does not work in the case of docker.