Make "host" parameter optional for PostgreSQL connections

Add a "host" component to the DSN only if $config array contains a "host" key

This fixes #1741