puppetlabs/puppetlabs-postgresql — pull request #352 by mkrakowitzer (2014-01-23 13:58:05+00:00)
Title: Add port option to postgresql::server

Added port attribute to postgresql::server.

I ran into an issue install an ubuntu 12.04LTS system where the default port was 5433 and puppet was failing with:
/usr/lib/postgresql/9.3/bin/createdb --owner='postgres' --template=template0 'xxxx'
createdb: could not connect to database template1: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?

strangely enough /usr/bin/createdb works fine, which is a link to: /usr/share/postgresql-common/pg_wrapper

Seemed easiest to add the port attribute with default 5432 to resolve my issue.