MediaWiki and Postgres
Posted by unbrand on 4 December 2005 | 0 Comments
With the recent Oracle purchase of InnoDB I’ve been looking more seriously at PostgreSQL. I’ve also been itching to get a wiki up and running for a household to-do list thing and in general, just to have a play wiki area to get ideas down and try new techie things.
In the past, I’ve set up MediaWiki at work and it was very useful as a project sandbox for us and our clients. Only problem (if you look at it that way) is that the released software only runs on MySQL. Recently though, Postgres support has been added. Currently in a pre-alpha stage we now have Wikipgedia.
Installing this bad boy has been somewhat challenging, for several reasons. For one, I went down some dead-end alleys trying to get things working. Specifically, I’m running Postgres 8.1 on Debian but I noticed my libpq was at 8.0.4. I was having some general PHP-Postgres connectivity problems at one point so I thought I needed to rebuild libpq from 8.1 source. In the end, I think this was completely unnecessary, but hopefully not destructive.
Following are a couple notes about how I got things working in the hopes that it may help someone avoid a bit of aggravation.
- Read this: How To Install Wikipgedia. It’s a good general overview of what needs to be done.
- I had to change the default schema from ‘mediawiki’ to ‘public’ in $wgDBschema in DefaultSettings.php before running the PHP portion of the install process. I’m not sure if this is really necessary, but it helped me get closer to a working solution.
- And here’s the bit where I really got stuck: After installation, whenever I tried to save or search, I would get “could not find tsearch config by locale”. After reading as much doc as I could find, here’s what worked for me. Go into a postgres shell and say:
prompt# show_all; --- look for the lc_ctype value. For me it was en_GB. Use value in the UPDATE below ---
prompt# UPDATE pg_ts_cfg set locale='en_GB' WHERE ts_name = 'default';
After that, everything worked. Now I have a working 1.6 pre-alpha MediaWiki talking to Postgres 8.1 on Debian. Things seem good so far; no problems that I can see. And my server is now MySQL-free. :-)