From Meta, a Wikimedia project coordination wiki
Jump to: navigation, search
Ambox outdated content.svg

This page is outdated.
Please see Manual:PostgreSQL on for more up to date informations.

MediaWiki logo

The experimental PostgreSQL support has not been maintained; MediaWiki 1.5 is not able to run on PostgreSQL and will not until/unless someone interested puts in the necessary work to update the files. --brion 07:40, 21 Jun 2005 (UTC)

On that note, for those still interested, there is Wikipgedia. It's far from complete, but definitely still being worked upon. -- 19:03, 16 February 2006 (UTC)

This is a work-in-progress. More details to be forthcoming as I discover them.  :) --User:ChadMiller 19:36, 7 Dec 2004 (UTC)


MediaWiki 1.4 will be adding support for PostgreSQL as a back-end database.

As of September 2004, the installer doesn't support it and various functions are still incomplete or have errors: see the tracking entry in bugzilla for remaining problems.


Patches available at !

Update: Several of these patches are now included in CVS (without attribution in the log :P ). If 'patch' asks if you really mean to reverse a patch, then it's probably already applied. --ChadMiller 21:59, 19 Jan 2005 (UTC)


The description that follows assumes that you have PostgreSQL installed and running. You can create users and databases and connect to the local databases from the command-line utility "psql".

If that isn't true, then you should look elsewhere for help.

Creating the Database[edit]

After you fill out the initial Mediawiki setup form in config/index.php, but before you submit it, you need to use that information to prepare bits of the database that the setup can not (yet) perform.

If you will use the same machine for database server and web server, then the "" blocks below will actually be on the same machine and have the same prompt. If you use the same machine, you may leave the "server" fields blank and db connections will go through a Unix domain socket, which is a very fast transport -- much faster than merely connecting through IP to "localhost" or a remote server.

First, you should have the database owned by a normal user account. Use your normal Unix username, if you like; it's a common thing to do. Then create the database user that Mediawiki will use, and then create the schema and give the user permissions to use that schema. If you're using the default PostgreSQL schema, "public", then you need not create it, but you should still grant the user permissions to use it

dbhostshell$  createdb databasename
dbhostshell$  psql databasename

databasename=# create user databaseuser with encrypted password databasepassword;
databasename=# create schema schemaname;    -- if not "public"
databasename=# grant create, usage on schema schemaname to databaseuser;
databasename=# \q

Now, edit your pg_hba.conf file and set it so the database user on the web server can authenticate to the database. This can be tricky. Consult PostgreSQL documentation for details, but this author is using a local server and his file contains this:

local   chadwikitwo  mediawiki                                     md5

To verify that database connectivity works, try one of these:

webhostshell$  psql databasename -U databaseuser -h databaseserveraddress
Password:  databasepassword


webhostshell$  psql databasename -U databaseuser   # for local Unix domain connections
Password:  databasepassword

If you can reach the database using the username and password from the host that's running the web server, then you're ready to submit the form.


The form in config/index.php will run and perhaps give a few warnings.

(More to come.)