Added PostgreSQL support for non-standard ports (Issue #4152).

Here is a pull request as described in my previous issue #4152.

I have tested it with and without port definition and both works in my configuration.