Page MenuHomePhabricator

Configuration directive ($wgDBmwschema) under the PostgreSQL backend is only used while installing
Closed, ResolvedPublic

Description

Author: yet_another_one_time_use_bugzilla_account

Description:
The configuration directive in LocalSettings.php that controls a wiki's database schema name ($wgDBmwschema) only appears to have relevance when creating Mediawiki's tables under PostgreSQL. As far as I can tell, the database abstraction relies on the fact that it somehow overwrites search_path during schema initialization to subsequently find the tables instead of actually using the configuration variable.

This makes two things very difficult under MediaWiki and PostgreSQL:

  1. Renaming the wiki's schema. Logic would dictate that you could simply change LocalSettings.php:$wgDBmwschema and then ALTER SCHEMA mediawiki RENAME TO mediawiki_meaningful_description;, but this does not work.
  1. Running multiple wiki's on the same database in different schemas. When you install the first one it works just fine. When you install the second one, both the first and second wiki installations are in fact accessing the same schema.

Version: 1.11.x
Severity: minor
OS: Linux

Details

Reference
bz12936

Related Objects

View Standalone Graph
This task is connected to more than 200 other tasks. Only direct parents and subtasks are shown here. Use View Standalone Graph to show more of the graph.

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 10:07 PM
bzimport set Reference to bz12936.

yet_another_one_time_use_bugzilla_account wrote:

Fix for postgresql schema issue

Should fix the schema problem in mediawiki under postgres.

Attached:

Please see the changes in r25929 and see if that does what you need.

sven wrote:

To achieve 1) you only need to run maintenance/update.php afterwards which will adjust search_path of the database user according to LocalSettings.php or adjust search_path of the database user manually with ALTER USER $wgDBuser SET search_path = $wgDBmwschema, $wgDBts2schema;

You'll need separate users to achieve number 2, but I just applied a patch from Sven in r32174 that should make #1 work reliably (thanks Sven!)

Jdforrester-WMF subscribed.

Migrating from the old tracking task to a tag for PostgreSQL-related tasks.