summaryrefslogtreecommitdiffstats
path: root/system/database/drivers/postgre/postgre_driver.php
diff options
context:
space:
mode:
authorDerek Jones <derek.jones@ellislab.com>2008-01-29 19:44:54 +0100
committerDerek Jones <derek.jones@ellislab.com>2008-01-29 19:44:54 +0100
commitc6ad0237eb6957046343ca654ab1c7d26787d466 (patch)
tree6e758af4fa59c9f45d011185de36abbc1708535a /system/database/drivers/postgre/postgre_driver.php
parent1d3137b68e41bff7541fa249d8946409d463f7f2 (diff)
Abstracted FROM table listing in Active Record for databases that do not support parenthetic grouping of tables to explicitly define operator precedence
Diffstat (limited to 'system/database/drivers/postgre/postgre_driver.php')
-rw-r--r--system/database/drivers/postgre/postgre_driver.php22
1 files changed, 22 insertions, 0 deletions
diff --git a/system/database/drivers/postgre/postgre_driver.php b/system/database/drivers/postgre/postgre_driver.php
index 96cf2dfe9..20f91650a 100644
--- a/system/database/drivers/postgre/postgre_driver.php
+++ b/system/database/drivers/postgre/postgre_driver.php
@@ -470,6 +470,28 @@ class CI_DB_postgre_driver extends CI_DB {
// --------------------------------------------------------------------
/**
+ * From Tables
+ *
+ * This function implicitly groups FROM tables so there is no confusion
+ * about operator precedence in harmony with SQL standards
+ *
+ * @access public
+ * @param type
+ * @return type
+ */
+ function _from_tables($tables)
+ {
+ if (! is_array($tables))
+ {
+ $tables = array($tables);
+ }
+
+ return '('.implode(', ', $tables).')';
+ }
+
+ // --------------------------------------------------------------------
+
+ /**
* Insert statement
*
* Generates a platform-specific insert string from the supplied data