Skip to content
Permalink
Browse files

Fixing some problems in in DboPostgres::connect()

  • Loading branch information...
lorenzo committed Oct 19, 2010
1 parent edd448f commit 3f0c79f7f935f83601445f62249ee7ac28be67c6
Showing with 4 additions and 5 deletions.
  1. +4 −5 cake/libs/model/datasources/dbo/dbo_postgres.php
@@ -117,21 +117,20 @@ function connect() {
$flags = array(
PDO::ATTR_PERSISTENT => $config['persistent']
);
if (!empty($config['encoding'])) {
$flags[PDO::MYSQL_ATTR_INIT_COMMAND] = 'SET search_path TO ' . $config['schema'];
}
$this->_connection = new PDO(
"pgsql:host={$config['host']};port={$config['port']};dbname={$config['database']}",
$config['login'],
$config['password'],
$flags
);
$this->connected = true;
if (!empty($config['encoding'])) {
$this->setEncoding($config['encoding']);
}
$this->connected = true;
if (!empty($config['schema'])) {
$this->_execute('SET search_path TO ' . $config['schema']);
}
} catch (PDOException $e) {
$this->errors[] = $e->getMessage();
}

0 comments on commit 3f0c79f

Please sign in to comment.
You can’t perform that action at this time.