Commit 5a4c0f2f authored by rocksfrow's avatar rocksfrow

rehashed charset implementation to support old versions of postgresql

parent 670f4669
......@@ -53,6 +53,11 @@ class Driver extends AbstractPostgreSQLDriver
$pdo->setAttribute(PDO::PGSQL_ATTR_DISABLE_PREPARES, true);
}
/* define charset via SET NAMES to avoid inconsistent DSN support */
if (isset($params['charset'])) {
$pdo->query('SET NAMES \''.$params['charset'].'\'');
}
return $pdo;
} catch (PDOException $e) {
throw DBALException::driverException($this, $e);
......@@ -82,10 +87,6 @@ class Driver extends AbstractPostgreSQLDriver
$dsn .= 'dbname=' . $params['dbname'] . ' ';
}
if (isset($params['charset'])) {
$dsn .= 'client_encoding=' . $params['charset'] . ' ';
}
if (isset($params['sslmode'])) {
$dsn .= 'sslmode=' . $params['sslmode'] . ' ';
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment