From: Domas Mituzas Date: Fri, 17 Sep 2004 13:47:28 +0000 (+0000) Subject: Add schema (logical namespace) support, table prefixes are not needed for PG... X-Git-Tag: 1.5.0alpha1~1987 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/banques/ajouter.php?a=commitdiff_plain;h=9ee14e9268def0389cd2890497bb005ea6d8d0ef;p=lhc%2Fweb%2Fwiklou.git Add schema (logical namespace) support, table prefixes are not needed for PG... --- diff --git a/includes/DatabasePostgreSQL.php b/includes/DatabasePostgreSQL.php index 27bab67bf9..f38b70c3da 100644 --- a/includes/DatabasePostgreSQL.php +++ b/includes/DatabasePostgreSQL.php @@ -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; } diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index e03022b7a2..5401b42387 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -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