Unfortunately the installer does not return the real error.
Here are some general tips:
- make sure the provided database already exists
- check if your database needs some specific settings, such as a different port or
sslmode=require
Put your connection details in a normal php file and run the script, having error reporting enabled:
<?php
$connection = 'host=127.0.0.1 port=5432 dbname=joomla3 user=postgres password=postgres';
$dbconn = pg_connect($connection);
var_dump($dbconn);
When running the script you might get a proper error. When you get a resource, the connection is successful: resource(4) of type (pgsql link)