Last modified: 2014-11-14 23:28:06 UTC
This the PostgreSQL equivalent to bug 71040 for Oracle.
Change 170395 had a related patch set uploaded by Jjanes: PostgreSQL: Port update-keys.sql to PostgreSQL https://gerrit.wikimedia.org/r/170395
What error message are you getting with PostgreSQL (Oracle needs "FROM DUAL" after "SELECT"...)
Ok, I managed to reproduce it finally: Query: INSERT IGNORE INTO "mediawiki"."updatelog" SELECT 'filearchive-fa_major_mime-patch-fa_major_mime-chemical.sql' AS ul_key, null as ul_value UNION SELECT 'image-img_major_mime-patch-img_major_mime-chemical.sql', null UNION SELECT 'oldimage-oi_major_mime-patch-oi_major_mime-chemical.sql', null UNION SELECT 'user_groups-ug_group-patch-ug_group-length-increase-255.sql', null UNION SELECT 'user_former_groups-ufg_group-patch-ufg_group-length-increase-255.sql', null UNION SELECT 'user_properties-up_property-patch-up_property.sql', null Function: DatabaseBase::sourceFile( /usr/home/saper/public_html/pg/w/maintenance/update-keys.sql ) Error: 42601 ERROR: syntax error at or near "IGNORE" LINE 1: ...l/pg/w/maintenance/update-keys.sql ) 127.0.0.1 */ IGNORE INT...
The IGNORE in "INSERT IGNORE" from the default version of the file (for MySQL and sqlite) is not valid syntax in PostgreSQL. ERROR: syntax error at or near "IGNORE" at character 115 STATEMENT: INSERT /* DatabaseBase::sourceFile( /usr/local/apache2/htdocs/wiki_git/maintenance/update-keys.sql ) 127.0.0.1 */ IGNORE INTO "public"."updatelog" ... The fix for the bug against Oracle claims the IGNORE is not needed because this file is only run against fresh installs so there cannot be primary key violations.
This bug was caused by change d315c3bdb34bce9327a494e9edf5fe3774b81d7b which added INSERT IGNORE. So there are two issues: 1) Missing "FROM tablename" for Oracle (we can add "FROM revision" just for sanity) 2) Updating updatelog table by hand in a funny way. We have already "LoggedUpdateMaintenance" to deal with those....
Do we want to wait for the issues from Gerrit change #135756 to get fixed for all databases? I'd rather have Jeff's patch merged now as this bug is a blocker for PostgreSQL and leave the clean-up for later as that is a (minor) pain point for all databases.
*** Bug 73434 has been marked as a duplicate of this bug. ***