From 9ee14e9268def0389cd2890497bb005ea6d8d0ef Mon Sep 17 00:00:00 2001 From: Domas Mituzas Date: Fri, 17 Sep 2004 13:47:28 +0000 Subject: [PATCH] Add schema (logical namespace) support, table prefixes are not needed for PG... --- includes/DatabasePostgreSQL.php | 3 +++ includes/DefaultSettings.php | 7 +++++++ 2 files changed, 10 insertions(+) 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 -- 2.20.1