summaryrefslogtreecommitdiffstats
path: root/system/database/drivers/pdo/subdrivers
diff options
context:
space:
mode:
authorAndrey Andreev <narf@bofh.bg>2012-12-03 13:55:56 +0100
committerAndrey Andreev <narf@bofh.bg>2012-12-03 13:55:56 +0100
commit0259d1240d298beb71627da9c808c2f6a41e4656 (patch)
treefcef85bc679b1d7aca67ed0c30c521034cc5757b /system/database/drivers/pdo/subdrivers
parent838a9d69a9139b6bcd6f8765fdd2d58b929e70ad (diff)
Improve schema support for Postgre
Diffstat (limited to 'system/database/drivers/pdo/subdrivers')
-rw-r--r--system/database/drivers/pdo/subdrivers/pdo_pgsql_driver.php20
1 files changed, 20 insertions, 0 deletions
diff --git a/system/database/drivers/pdo/subdrivers/pdo_pgsql_driver.php b/system/database/drivers/pdo/subdrivers/pdo_pgsql_driver.php
index 1300772c5..2eb0606b3 100644
--- a/system/database/drivers/pdo/subdrivers/pdo_pgsql_driver.php
+++ b/system/database/drivers/pdo/subdrivers/pdo_pgsql_driver.php
@@ -90,6 +90,26 @@ class CI_DB_pdo_pgsql_driver extends CI_DB_pdo_driver {
// --------------------------------------------------------------------
/**
+ * Database connection
+ *
+ * @param bool $persistent
+ * @return object
+ */
+ public function db_connect($persistent = FALSE)
+ {
+ $this->conn_id = parent::db_connect($persistent);
+
+ if (is_object($this->conn_id) && ! empty($this->schema))
+ {
+ $this->simple_query('SET search_path TO '.$this->schema.',public');
+ }
+
+ return $this->conn_id;
+ }
+
+ // --------------------------------------------------------------------
+
+ /**
* Insert ID
*
* @param string $name