Fixes database connection issue related to creating new empty postgresql...

Fixes issue when creating a new postgresql db when the db call is meant to connect to template1 database to check and create the new database.