summaryrefslogtreecommitdiff
path: root/program/include/rcube_mdb2.php
diff options
context:
space:
mode:
authoralecpl <alec@alec.pl>2008-10-10 10:07:46 +0000
committeralecpl <alec@alec.pl>2008-10-10 10:07:46 +0000
commit9f23f0522112441fac313330424a680da809d4f4 (patch)
tree5d889b0123101e62cf91b25fe0742d3750bdfb0b /program/include/rcube_mdb2.php
parent8e83075d7ec49cd8f388039e5ae821f00173411b (diff)
- set MDB2's sequence options for postgres only
Diffstat (limited to 'program/include/rcube_mdb2.php')
-rw-r--r--program/include/rcube_mdb2.php13
1 files changed, 9 insertions, 4 deletions
diff --git a/program/include/rcube_mdb2.php b/program/include/rcube_mdb2.php
index 2deaa416d..eb6cec9c8 100644
--- a/program/include/rcube_mdb2.php
+++ b/program/include/rcube_mdb2.php
@@ -78,14 +78,19 @@ class rcube_mdb2
function dsn_connect($dsn)
{
// Use persistent connections if available
- $dbh = MDB2::connect($dsn, array(
+ $db_options = array(
'persistent' => $this->db_pconn,
'emulate_prepared' => $this->debug_mode,
'debug' => $this->debug_mode,
'debug_handler' => 'mdb2_debug_handler',
- 'disable_smart_seqname' => true, // for postgresql
- 'seqname_format' => '%s', // for postgresql
- 'portability' => MDB2_PORTABILITY_ALL ^ MDB2_PORTABILITY_EMPTY_TO_NULL));
+ 'portability' => MDB2_PORTABILITY_ALL ^ MDB2_PORTABILITY_EMPTY_TO_NULL);
+
+ if ($this->db_provider == 'pgsql') {
+ $db_options['disable_smart_seqname'] = true;
+ $db_options['seqname_format'] = '%s';
+ }
+
+ $dbh = MDB2::connect($dsn, $db_options);
if (MDB2::isError($dbh))
{