Manual:PostgreSQL/zh

The purpose of this page is to collect information and experiences about running MediaWiki on PostgreSQL.

MediaWiki supports PostgreSQL since 1.7. See Phabricator for a list of issues. MediaWiki requires PostgreSQL or later, and PG database support enabled in PHP.

Most of the common maintenance scripts work with PostgreSQL however some of the more obscure ones might have problems.

PostgreSQL对于MediaWiki是一个好选择吗？
维基百科使用MySQL，所以与PostgreSQL相比，MediaWiki更多地在MySQL上测试. 而PostgreSQL支持是由志愿者维护的，多数的核心功能是正常工作的.

从MySQL到PostgreSQL
工具可能有所帮助.

There is also a perl script in maintenance/postgres, but there is uncertainty whether it works.

从PostgreSQL到MySQL
This is generally not recommended as converting from Postgres data types back to MySQL is not as simple an operation as the reverse.

There are however some scripts which may work.

Installation of MediaWiki with PostgreSQL and Nginx
The methods below briefly describe ways to install with PostgreSQL 9.5.2 and Nginx 1.8 from their source on Ubuntu 14.04.

For cleaner and simpler maintenance, all the programs are installed in /home/s/src

Installation of MediaWiki with PostgreSQL and Nginx on Ubuntu 16.04
This also works in Debian 9, if su is used instead of sudo.
 * 1) Install the required packages
 * 2) Edit /etc/nginx/sites-available/default and add index.php and enable PHP FPM
 * 3) Restart nginx
 * 4) Create a database user   and database
 * 5) Go to the Nginx root   and clone MediaWiki
 * 6) Change the owner of images to Nginx   to allow file uploads
 * 7) Open a web browser to  http://localhost/mediawiki  and start the MediaWiki configuration
 * 1) Change the owner of images to Nginx   to allow file uploads
 * 2) Open a web browser to  http://localhost/mediawiki  and start the MediaWiki configuration