| 1 |
This document describes the state of Postgres support in MediaWiki. |
| 2 |
|
| 3 |
== Overview == |
| 4 |
|
| 5 |
Support for PostgreSQL has been available since version 1.7 |
| 6 |
of MediaWiki, and is fairly well maintained. The main code |
| 7 |
is very well integrated, while extensions are very hit and miss. |
| 8 |
Still, it is probably the most supported database after MySQL. |
| 9 |
Much of the work in making MediaWiki database-agnostic came |
| 10 |
about through the work of creating Postgres support. |
| 11 |
|
| 12 |
== Required versions == |
| 13 |
|
| 14 |
The current minimum version of PostgreSQL for MediaWiki is 10. |
| 15 |
|
| 16 |
== Database schema == |
| 17 |
|
| 18 |
PostgreSQL schema is automatically generated from the abstract schema. |
| 19 |
You can see the generated schema in maintenance/postgres/tables-generated.sql |
| 20 |
|
| 21 |
For more information on abstract schema see: |
| 22 |
https://www.mediawiki.org/wiki/Manual:Schema_changes |
| 23 |
|
| 24 |
== MySQL differences == |
| 25 |
|
| 26 |
The major differences between MySQL and Postgres are represented as |
| 27 |
methods in the Database class. For example, implicitGroupby() is |
| 28 |
true for MySQL and false for Postgres. This means that in those |
| 29 |
places where the code does not add all the non-aggregate items |
| 30 |
from the SELECT clause to the GROUP BY, we can add them in, but in |
| 31 |
a conditional manner with the above method, as simply adding them |
| 32 |
all in to the main query may cause performance problems with |
| 33 |
MySQL. |
| 34 |
|
| 35 |
== Getting help == |
| 36 |
|
| 37 |
In addition to the normal venues (MediaWiki mailing lists |
| 38 |
and IRC channels), the #postgresql channel on irc.libera.chat |
| 39 |
is a friendly and expert resource if you should encounter a |
| 40 |
problem with your Postgres-enabled MediaWiki. |