Last modified: 2012-08-04 20:48:53 UTC
When running the update script it throws this error: ==== MediaWiki 1.12alpha Updater Going to run database updates for wikidb Depending on the size of your database this may take a while! Abort with control-c in the next five seconds...0 ...cu_changes already exists. Warning: pg_query(): Query failed: ERROR: syntax error at or near ")" LINE 13: ) ^ in /home/wiki/includes/DatabasePostgres.php on line 542 ...cu_log added ...log file missing, skipping log import. Warning: pg_query(): Query failed: ERROR: current transaction is aborted, commands ignored until end of transaction block in /home/wiki/includes/DatabasePostgres.php on line 542 Warning: pg_fetch_result(): supplied argument is not a valid PostgreSQL result resource in /home/wiki/maintenance/updaters.inc on line 1273 Notice: Undefined offset: 1 in /home/wiki/maintenance/updaters.inc on line 1276 Adding in schema "mediawiki" to search_path for user "wikiuser" Adding in schema "public" to search_path for user "wikiuser" Warning: pg_query(): Query failed: ERROR: current transaction is aborted, commands ignored until end of transaction block in /home/wiki/includes/DatabasePostgres.php on line 542 Warning: pg_query(): Query failed: ERROR: current transaction is aborted, commands ignored until end of transaction block in /home/wiki/includes/DatabasePostgres.php on line 542 Setting client_min_messages to 'error' for user "wikiuser" Warning: pg_query(): Query failed: ERROR: current transaction is aborted, commands ignored until end of transaction block in /home/wiki/includes/DatabasePostgres.php on line 542 Warning: pg_query(): Query failed: ERROR: current transaction is aborted, commands ignored until end of transaction block in /home/wiki/includes/DatabasePostgres.php on line 542 Setting DateStyle to 'ISO, YMD' for user "wikiuser" Warning: pg_query(): Query failed: ERROR: current transaction is aborted, commands ignored until end of transaction block in /home/wiki/includes/DatabasePostgres.php on line 542 Warning: pg_query(): Query failed: ERROR: current transaction is aborted, commands ignored until end of transaction block in /home/wiki/includes/DatabasePostgres.php on line 542 Setting TimeZone to 'GMT' for user "wikiuser" Warning: pg_query(): Query failed: ERROR: current transaction is aborted, commands ignored until end of transaction block in /home/wiki/includes/DatabasePostgres.php on line 542 Warning: pg_query(): Query failed: ERROR: current transaction is aborted, commands ignored until end of transaction block in /home/wiki/includes/DatabasePostgres.php on line 542 Warning: pg_query(): Query failed: ERROR: current transaction is aborted, commands ignored until end of transaction block in /home/wiki/includes/DatabasePostgres.php on line 542 A database error has occurred Query: SELECT 1 FROM pg_catalog.pg_class c, pg_catalog.pg_namespace n WHERE c.relnamespace = n.oid AND c.relname = 'log_log_id_seq' AND n.nspname = 'mediawiki' AND c.relkind IN ('S') Function: Error: 1 ERROR: current transaction is aborted, commands ignored until end of transaction block Backtrace: #0 /home/wiki/includes/Database.php(799): DatabasePostgres->reportQueryError('ERROR: current...', 1, 'SELECT 1 FROM p...', '', false) #1 /home/wiki/includes/DatabasePostgres.php(1003): Database->query('SELECT 1 FROM p...') #2 /home/wiki/includes/DatabasePostgres.php(1019): DatabasePostgres->relationExists('log_log_id_seq', 'S', false) #3 /home/wiki/maintenance/updaters.inc(1408): DatabasePostgres->sequenceExists('log_log_id_seq') #4 /home/wiki/maintenance/updaters.inc(944): do_postgres_updates() #5 /home/wiki/maintenance/update.php(59): do_all_updates(false, true) #6 {main} ===
After liberally adding some debug statements I believe I traced the problem statement to here: === SQL : CREATE /* Database::sourceStream */ SEQUENCE cu_log_cul_id_seq SQL : CREATE /* Database::sourceStream */ TABLE cu_log ( cul_id INTEGER NOT NULL DEFAULT nextval('cu_log_cul_id_seq'), cul_timestamp TIMESTAMPTZ, cul_user INTEGER NULL REFERENCES mwuser(user_id) ON DELETE SET NULL, cul_user_text TEXT NOT NULL, cul_reason TEXT NOT NULL DEFAULT '', cul_type TEXT NOT NULL DEFAULT '', cul_target_id INTEGER NULL REFERENCES mwuser(user_id) ON DELETE SET NULL, cul_target_text TEXT NOT NULL DEFAULT '', cul_target_hex TEXT NOT NULL DEFAULT '', cul_range_start TEXT NOT NULL DEFAULT '', cul_range_end TEXT NOT NULL DEFAULT '', ) Warning: pg_query(): Query failed: ERROR: syntax error at or near ")" LINE 13: ) ^ in /home/wiki/includes/DatabasePostgres.php on line 543 === As such, I believe this is a bug in the CheckUser extension rather then the DB.
Created attachment 4564 [details] Patch for invalid psql syntax
After fixing that line, the following CREATE INDEX lines caused errors as well.
(In reply to comment #3) > After fixing that line, the following CREATE INDEX lines caused errors as well. > As of the query on SVN now, what errors are given?
=== ERROR: syntax error at or near "," LINE 19: CREATE INDEX cul_user ON cu_log (cul_user), ===
(In reply to comment #5) > === > ERROR: syntax error at or near "," > LINE 19: CREATE INDEX cul_user ON cu_log (cul_user), > === > Bah, I thought I changed that already. Try r30032.
Done in r30032.