aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/db/postgres.php
diff options
context:
space:
mode:
authorDavid M <davidmj@users.sourceforge.net>2008-01-04 18:35:49 +0000
committerDavid M <davidmj@users.sourceforge.net>2008-01-04 18:35:49 +0000
commitaf738dbc2a48713f59779410955282aa5760b741 (patch)
tree35053fbc840e81689dada401b978ae8dfb181d33 /phpBB/includes/db/postgres.php
parentedd6c34eda14fbef5bd1e6502735c45d038d6575 (diff)
downloadforums-af738dbc2a48713f59779410955282aa5760b741.tar
forums-af738dbc2a48713f59779410955282aa5760b741.tar.gz
forums-af738dbc2a48713f59779410955282aa5760b741.tar.bz2
forums-af738dbc2a48713f59779410955282aa5760b741.tar.xz
forums-af738dbc2a48713f59779410955282aa5760b741.zip
Ch-ch-ch-changes
- Made us more DB independent by making many queries capability based instead of DB specific - Finished PHP5ifying of the acm_file class, now with some (hopefully) enhancements to its performance - Sped up viewforum considerably (also goes towards mcp_forum) I really hope I didn't explode CVS... git-svn-id: file:///svn/phpbb/trunk@8301 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/db/postgres.php')
-rw-r--r--phpBB/includes/db/postgres.php28
1 files changed, 25 insertions, 3 deletions
diff --git a/phpBB/includes/db/postgres.php b/phpBB/includes/db/postgres.php
index 0ac27023f3..0f946c2d7c 100644
--- a/phpBB/includes/db/postgres.php
+++ b/phpBB/includes/db/postgres.php
@@ -27,7 +27,7 @@ class dbal_postgres extends dbal
{
var $last_query_text = '';
var $pgsql_version;
-
+
/**
* Connect to server
*/
@@ -84,9 +84,17 @@ class dbal_postgres extends dbal
// determine what version of PostgreSQL is running, we can be more efficient if they are running 8.2+
$this->pgsql_version = @pg_parameter_status($this->db_connect_id, 'server_version');
- if (!empty($this->pgsql_version) && $this->pgsql_version[0] >= '8' && $this->pgsql_version[2] >= '2')
+ if (!empty($this->pgsql_version) && $this->pgsql_version[0] >= '8')
{
- $this->multi_insert = true;
+ if ($this->pgsql_version[2] >= '1')
+ {
+ $this->multi_table_deletion = true;
+ }
+
+ if ($this->pgsql_version[2] >= '2')
+ {
+ $this->multi_insert = true;
+ }
}
if ($schema !== '')
@@ -332,6 +340,20 @@ class dbal_postgres extends dbal
}
/**
+ * Expose a DBMS specific function
+ */
+ function sql_function($type, $col)
+ {
+ switch ($type)
+ {
+ case 'length_varchar':
+ case 'length_text':
+ return 'LENGTH(' . $col . ')';
+ break;
+ }
+ }
+
+ /**
* Build LIKE expression
* @access private
*/