summaryrefslogtreecommitdiffstats
path: root/system/drivers/DB_postgre.php
diff options
context:
space:
mode:
authoradmin <devnull@localhost>2006-09-23 22:25:05 +0200
committeradmin <devnull@localhost>2006-09-23 22:25:05 +0200
commite885d787cde65d9ab003426bf79047de57c83ebe (patch)
tree1421b7cca06f61b1b0274b238d6f9fbf39afd679 /system/drivers/DB_postgre.php
parent66530a809018c2ba39d9adb5b2cf21640969e472 (diff)
Diffstat (limited to 'system/drivers/DB_postgre.php')
-rw-r--r--system/drivers/DB_postgre.php76
1 files changed, 74 insertions, 2 deletions
diff --git a/system/drivers/DB_postgre.php b/system/drivers/DB_postgre.php
index 57ef179d9..fe7c704f9 100644
--- a/system/drivers/DB_postgre.php
+++ b/system/drivers/DB_postgre.php
@@ -81,7 +81,7 @@ class CI_DB_postgre extends CI_DB {
* @param string an SQL query
* @return resource
*/
- function execute($sql)
+ function _execute($sql)
{
$sql = $this->_prep_query($sql);
return @pg_query($this->conn_id, $sql);
@@ -102,7 +102,79 @@ class CI_DB_postgre extends CI_DB {
{
return $sql;
}
-
+
+ // --------------------------------------------------------------------
+
+ /**
+ * Begin Transaction
+ *
+ * @access public
+ * @return bool
+ */
+ function trans_begin()
+ {
+ if ( ! $this->trans_enabled)
+ {
+ return TRUE;
+ }
+
+ // When transactions are nested we only begin/commit/rollback the outermost ones
+ if ($this->_trans_depth > 0)
+ {
+ return TRUE;
+ }
+
+ return @pg_exec($this->conn_id, "begin");
+ }
+
+ // --------------------------------------------------------------------
+
+ /**
+ * Commit Transaction
+ *
+ * @access public
+ * @return bool
+ */
+ function trans_commit()
+ {
+ if ( ! $this->trans_enabled)
+ {
+ return TRUE;
+ }
+
+ // When transactions are nested we only begin/commit/rollback the outermost ones
+ if ($this->_trans_depth > 0)
+ {
+ return TRUE;
+ }
+
+ return @pg_exec($this->conn_id, "commit");
+ }
+
+ // --------------------------------------------------------------------
+
+ /**
+ * Rollback Transaction
+ *
+ * @access public
+ * @return bool
+ */
+ function trans_rollback()
+ {
+ if ( ! $this->trans_enabled)
+ {
+ return TRUE;
+ }
+
+ // When transactions are nested we only begin/commit/rollback the outermost ones
+ if ($this->_trans_depth > 0)
+ {
+ return TRUE;
+ }
+
+ return @pg_exec($this->conn_id, "rollback");
+ }
+
// --------------------------------------------------------------------
/**