Topic on Project:Support desk

Updating Mediawiki from 1.29 to 1.30 - Error: 42601 ERROR: syntax error at or near "ADD"

5
Summary by SoftekIS

Marking as resolved as this no longer effects us (we decided to just create a new wiki using MariaDB), and there is now a bug ticket for the PostgreSQL we had.

SoftekIS (talkcontribs)

Hi guys. Long story short, I've taken on the project of upgrading our Mediawiki from 1.15 (I know...) to 1.30. At this point, I've gotten it up to version 1.29 after sorting through the various changes/requirements. But I've finally hit a snag. After moving to version 1.30, it seems Mediawiki still functions just fine, but when I run update.php, I get the error below. In a perfect world we'd be on MySQL/MariaDB since it seems most people use that with Mediawiki, but this is something I've inherited:

----------------------------------------

...Adding value '3D' to enum type media_type.

[a9ba0b22d75b22a89e363931] [no req]   Wikimedia\Rdbms\DBQueryError from line 114   9 of /var/lib/mediawiki/includes/libs/rdbms/database/Database.php: A database qu   ery error has occurred. Did you forget to run your application's database schema    updater after upgrading?

Query: ALTER TYPE "media_type" ADD VALUE '3D'

Function: Wikimedia\Rdbms\Database::query

Error: 42601 ERROR:  syntax error at or near "ADD"

LINE 1: ...se::query root@testwiki... */ TYPE "media_type" ADD VALUE ...

                                                             ^

Backtrace:

#0 /var/lib/mediawiki/includes/libs/rdbms/database/DatabasePostgres.php(262): Wi   kimedia\Rdbms\Database->reportQueryError(string, string, string, string, boolean   )

#1 /var/lib/mediawiki/includes/libs/rdbms/database/Database.php(979): Wikimedia\   Rdbms\DatabasePostgres->reportQueryError(string, string, string, string, boolean   )

#2 /var/lib/mediawiki/includes/installer/PostgresUpdater.php(879): Wikimedia\Rdb   ms\Database->query(string)

#3 [internal function]: PostgresUpdater->addPgEnumValue(string, string)

#4 /var/lib/mediawiki/includes/installer/DatabaseUpdater.php(472): call_user_fun   c_array(array, array)

#5 /var/lib/mediawiki/includes/installer/DatabaseUpdater.php(436): DatabaseUpdat   er->runUpdates(array, boolean)

#6 /var/lib/mediawiki/maintenance/update.php(204): DatabaseUpdater->doUpdates(ar   ray)

#7 /var/lib/mediawiki/maintenance/doMaintenance.php(92): UpdateMediaWiki->execut   e()

#8 /var/lib/mediawiki/maintenance/update.php(249): require_once(string)

#9 {main}

----------------------------------------

Product Version
MediaWiki 1.30.0 (4c97eee)

00:35, 3 March 2018

PHP 5.5.38-1~dotdeb+7.1 (apache2handler)
PostgreSQL 8.4.22lts6

The end goal is to get this fully working with 1.30, and then create a fresh VM on Debian 9/Latest PostgreSQL.

Bawolff (talkcontribs)

the ADD VALUE syntax was only added in postgres 9.1. So you should probably move to postgres 9 before h

SoftekIS (talkcontribs)

I'll give that a shot tomorrow. My plan all along was to upgrade the database at some point, but was hoping to get everything working on 1.30 first. But if this works, it's good enough for me :)

SoftekIS (talkcontribs)

Update: upgraded PostgreSQL to 9.5.1, and the script worked. I noticed while reading the script that it references 1.31, so I wonder if that was even intended to be in 1.30 since 1.30 still says it only requires PostgreSQL 8.3+.

Regardless, thanks for the tip!

Bawolff (talkcontribs)