Commit d8cb9d35 authored by rocksfrow's avatar rocksfrow Committed by Steve Müller

rehashed charset implementation to support old versions of postgresql

parent e25ccaea
......@@ -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