Last modified: 2014-10-23 07:21:06 UTC
See the last functions in the file 'includes/installer/PostgresqlUpdater.php': protected function addInterwikiType() { $this->applyPatch( 'patch-add_interwiki.sql', false, "Refreshing add_interwiki()" ); } protected function tsearchFixes() { # Tweak the page_title tsearch2 trigger to filter out slashes # This is create or replace, so harmless to call if not needed $this->applyPatch( 'patch-ts2pagetitle.sql', false, "Refreshing ts2_page_title()" ); # If the server is 8.3 or higher, rewrite the tsearch2 triggers # in case they have the old 'default' versions # Gather version numbers in case we need them if ( $this->db->getServerVersion() >= 8.3 ) { $this->applyPatch( 'patch-tsearch2funcs.sql', false, "Rewriting tsearch2 triggers" ); } } All these *.sql files are missing. Moreover, addInterwikiType() calls even if interwiki table already exists. Also patch-interwiki.sql for PostgreSQL should be: CREATE TABLE /*$wgDBprefix*/interwiki ( -- The interwiki prefix, (e.g. "Meatball", or the language prefix "de") iw_prefix varchar(32) NOT NULL, -- The URL of the wiki, with "$1" as a placeholder for an article name. -- Any spaces in the name will be transformed to underscores before -- insertion. iw_url byteea NOT NULL, -- A boolean value indicating whether the wiki is in this project -- (used, for example, to detect redirect loops) iw_local BOOL NOT NULL, PRIMARY KEY (iw_prefix), UNIQUE (iw_prefix) ) /*$wgDBTableOptions*/; But this is could be wrong too - upgrade script suggests that iw_local column translating into smallint type, so it should be already smallint from the start (bool->smallint translation is not allowed, afair). So these SQL files and updater scripts should be syncronised for consistency.
Thanks for taking the time to report this! In case you (or anybody) feel like cooking up a patch, you are welcome to use Developer access https://www.mediawiki.org/wiki/Developer_access to submit this as a Git branch directly into Gerrit: https://www.mediawiki.org/wiki/Git/Tutorial If you don't want to set up Git/Gerrit, you can also use https://tools.wmflabs.org/gerrit-patch-uploader/
Is there any way you keep getting an error message? A year ago I did extensive tests attempting to upgrade pretty various old PostgreSQL MediaWikis into something more recent. How old is your MediaWiki? How old is your PostgreSQL installation? Would that be possible for you to dump a schema of the database somewhere for me to test? (or even a whole DB if not private)? Assuming you have a question related to the code: This code relates to the "add_interwiki" SQL *function*, not table. "interwiki" TABLE (with iw_local as CHAR NOT NULL) existed forever in the history of the PostgreSQL port - the first checkin of the tables.sql files contains the table already. Only later some fields where changed (iw_local became SMALLINT as you mention) or were added, and this seems to be reflected in the PostgresUpdater. The code to add "add_interwiki" function lives in maintenance/postgres/archives/patch-add_interwiki.sql and seems to be fine to me.
Anton: Can you please answer comment 2?