summaryrefslogtreecommitdiffstats
path: root/system/database/drivers/postgre/postgre_driver.php
diff options
context:
space:
mode:
authorMelounek <petr@heralecky.cz>2012-10-05 15:50:00 +0200
committerMelounek <petr@heralecky.cz>2012-10-05 15:50:00 +0200
commitcc7c7c691ad16beb5040a8a1d07064e61b5e2167 (patch)
treef0ed98dc9f580bf38cfb13b72d8ab2cddfd69a3f /system/database/drivers/postgre/postgre_driver.php
parent58dfc089bf5b0ca35c2ff244e5bfdff726f9adcd (diff)
parent6123b61e8ec95ac91f67bfbf442e34021c922319 (diff)
update devel version
Diffstat (limited to 'system/database/drivers/postgre/postgre_driver.php')
-rw-r--r--system/database/drivers/postgre/postgre_driver.php22
1 files changed, 10 insertions, 12 deletions
diff --git a/system/database/drivers/postgre/postgre_driver.php b/system/database/drivers/postgre/postgre_driver.php
index e73122bc7..1d6e9567a 100644
--- a/system/database/drivers/postgre/postgre_driver.php
+++ b/system/database/drivers/postgre/postgre_driver.php
@@ -44,16 +44,6 @@ class CI_DB_postgre_driver extends CI_DB {
protected $_escape_char = '"';
- // clause and character used for LIKE escape sequences
- protected $_like_escape_str = " ESCAPE '%s' ";
- protected $_like_escape_chr = '!';
-
- /**
- * The syntax to count rows is slightly different across different
- * database engines, so this string appears in each driver and is
- * used for the count_all() and count_all_results() functions.
- */
- protected $_count_string = 'SELECT COUNT(*) AS ';
protected $_random_keyword = ' RANDOM()'; // database specific random keyword
/**
@@ -138,7 +128,15 @@ class CI_DB_postgre_driver extends CI_DB {
*/
public function db_pconnect()
{
- return @pg_pconnect($this->dsn);
+ $conn = @pg_pconnect($this->dsn);
+ if ($conn && pg_connection_status($conn) === PGSQL_CONNECTION_BAD)
+ {
+ if (pg_ping($conn) === FALSE)
+ {
+ return FALSE;
+ }
+ }
+ return $conn;
}
// --------------------------------------------------------------------
@@ -535,7 +533,7 @@ class CI_DB_postgre_driver extends CI_DB {
$cases = '';
foreach ($final as $k => $v)
{
- $cases .= $k.' = (CASE '.$k."\n"
+ $cases .= $k.' = (CASE '.$index."\n"
.implode("\n", $v)."\n"
.'ELSE '.$k.' END), ';
}