Add schema (logical namespace) support, table prefixes are not needed for PG...
authorDomas Mituzas <midom@users.mediawiki.org>
Fri, 17 Sep 2004 13:47:28 +0000 (13:47 +0000)
committerDomas Mituzas <midom@users.mediawiki.org>
Fri, 17 Sep 2004 13:47:28 +0000 (13:47 +0000)
includes/DatabasePostgreSQL.php
includes/DefaultSettings.php

index 27bab67..f38b70c 100644 (file)
@@ -53,6 +53,8 @@ class DatabasePgsql extends Database {
                        die( "PostgreSQL functions missing, have you compiled PHP with the --with-pgsql option?\n" );
                }
 
+               global $wgDBschema;
+
                $this->close();
                $this->mServer = $server;
                $this->mUser = $user;
@@ -75,6 +77,7 @@ class DatabasePgsql extends Database {
                        } else { 
                                $this->mOpened = true;
                        }
+                       $this->query("SET search_path = $wgDBschema,public");
                }
                return $this->mConn;
        }
index e03022b..5401b42 100644 (file)
@@ -162,8 +162,15 @@ $wgDBuser           = 'wikiuser';
 $wgDBtype           = "mysql";
 /** Table name prefix */
 $wgDBprefix         = ''; 
+/** Database schema
+ * on some databases this allows separate 
+ * logical namespace for application data
+ */
+$wgDBschema        = 'mediawiki';
 /**#@-*/
 
+
+
 # Shared database for multiple wikis.
 # Presently used for storing a user table for single sign-on
 # The server for this database must be the same as for the main