diff --git a/htdocs/core/db/pgsql.class.php b/htdocs/core/db/pgsql.class.php index 34297a7c1fc..d43aee672ca 100644 --- a/htdocs/core/db/pgsql.class.php +++ b/htdocs/core/db/pgsql.class.php @@ -380,7 +380,7 @@ class DoliDBPgsql if (! $name) $name="postgres"; // When try to connect using admin user // try first Unix domain socket (local) - if ((empty($host) || $host == "socket") && ! defined('NOLOCALSOCKETPGCONNECT')) + if ((! empty($host) && $host == "socket") && ! defined('NOLOCALSOCKETPGCONNECT')) { $con_string = "dbname='".$name."' user='".$login."' password='".$passwd."'"; // $name may be empty $this->db = pg_connect($con_string);