diff --git a/src/Indexer/TNTIndexer.php b/src/Indexer/TNTIndexer.php index 26ee374..35a3112 100644 --- a/src/Indexer/TNTIndexer.php +++ b/src/Indexer/TNTIndexer.php @@ -152,9 +152,18 @@ protected function getHostDsn(array $config) } if ($driver == 'pgsql') { - return "pgsql:{$host}dbname={$database}"; - } + $host = isset($host) ? "host={$host};" : ''; + $dsn = "pgsql:{$host}dbname={$database}"; + if (isset($config['port'])) { + $dsn .= ";port={$port}"; + } + if (isset($config['sslmode'])) { + $dsn .= ";sslmode={$sslmode}"; + } + + return $dsn; + } } public function query($query)