Added support for external Postgres servers

This PR adds support for using an external postgres server