I did some research and I ended up with the following result.
You have not enabled the PostgreSQL module on your server.
If you have it, enable php.ini by removing ';'
Windows:
Edit php.ini: extension = php_pgsql.dll
Linux:
Install the module: php-pgsql
Edit php.ini: extension = pgsql.so
Tutorial:
Linux: Configure PostgreSQL to Work With PHP
Windows: a PHP / MySQL / a>
Since you have already said that you have modified php.ini and are using UolHost, and according to their support:
Our PHP supports MySQL and SQL Server database. Also installed are modules for access to PostgreSQL and Firebird (which can be accessed remotely).
OBS: It is always recommended to access the databases on the same local network. If there are performance issues with accessing a remote base, we may contact and disable the hosting service.
In this way I advise you to look directly at the UolHost support to check your settings and if necessary to do some release of some specific module