Last modified: 2012-08-04 20:48:56 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T24767, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 22767 - Error upgrading from 1.15 to 1.16 on Postgres
Error upgrading from 1.15 to 1.16 on Postgres
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
Database (Other open bugs)
1.16.x
All All
: Normal critical (vote)
: ---
Assigned To: Greg Sabino Mullane
:
Depends on:
Blocks: postgres
  Show dependency treegraph
 
Reported: 2010-03-08 17:48 UTC by Max Semenik
Modified: 2012-08-04 20:48 UTC (History)
5 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Max Semenik 2010-03-08 17:48:51 UTC
From IRC:
<locriani> Warning: pg_query(): Query failed: ERROR:  relation "cu_changes_cu_id_seq" already exists in /var/www/dfwiki/includes/db/DatabasePostgres.php on line 580
Comment 1 Greg Sabino Mullane 2010-03-22 14:59:48 UTC
What's the context - what were you doing when this occurred? What was the last thing output before this error message?
Comment 2 Zach Gardner 2010-04-05 03:47:35 UTC
That's the only output from the update.php script.  I was attempting to upgrade from 1.15 to 1.16.
Comment 3 qji 2010-08-24 14:04:24 UTC
I tried upgrade from mediawiki 1.15.1 to 1.16.0.
I get this error when I run update.php:

---------------------------------------
Updating sequence names
Warning: pg_query(): Query failed: ERROR:  syntax error at or near "RENAME"
LINE 1: ...aseBase::sourceStream  */ SEQUENCE rev_rev_id_val RENAME TO ...
                                                             ^ in /................/mediawiki-1.16.0/includes/db/DatabasePostgres.php on line 584
A database error has occurred
Query: ALTER SEQUENCE rev_rev_id_val RENAME TO revision_rev_id_seq

Function: DatabaseBase::sourceStream
Error: 1 ERROR:  syntax error at or near "RENAME"
LINE 1: ...aseBase::sourceStream  */ SEQUENCE rev_rev_id_val RENAME TO ...
---------------------------------------

My postgres version is 8.1 and I afraid, there isn't "ALTER SEQUENCE .... RENAME" comman on 8.1 only on 8.3 (and above).

http://www.postgresql.org/docs/8.1/static/sql-altersequence.html
http://www.postgresql.org/docs/8.3/static/sql-altersequence.html

PostgreSQL 8.1 isn't really supported?
Comment 4 Greg Sabino Mullane 2010-08-24 14:45:32 UTC
I'll look into fixing this, but it is very likely that 8.1 will not be supported moving forward, as it is not going to be officially supported much longer.
Comment 5 Zach Gardner 2010-08-24 17:15:33 UTC
My issue occurs with PG 8.4.
Comment 6 Greg Sabino Mullane 2010-08-24 17:24:33 UTC
(In reply to comment #5)
> My issue occurs with PG 8.4.

I think the issue you saw has already been fixed (indeed, I think the fix is *causing* the 8.1 issues!)
Comment 7 Zach Gardner 2010-08-24 17:26:04 UTC
Whoops, indeed it has.  My apologies for not actually paying attention!
Comment 8 sacher 2011-02-10 15:50:11 UTC
Hi there,
we are using PGSQL 8.1.13 and MW 1.16.1 now. 

The ALTER SEQUENCE x RENAME TO y; is not available with PGSQL 8.2 and below, it is a feature in PGSQL 8.3. Just change ALTER SEQUENCE into ALTER TABLE.

http://www.postgresql.org/docs/8.1/static/sql-altersequence.html
http://www.postgresql.org/docs/8.3/static/sql-altersequence.html

To use the updater you need to modify "... /maintenance/postgres/archives/patch-update_sequences.sql" as follows: 

ALTER TABLE rev_rev_id_val RENAME TO revision_rev_id_seq;
ALTER TABLE revision ALTER COLUMN rev_id SET DEFAULT NEXTVAL('revision_rev_id_seq');

ALTER TABLE text_old_id_val RENAME TO text_old_id_seq;
ALTER TABLE pagecontent ALTER COLUMN old_id SET DEFAULT nextval('text_old_id_seq');

ALTER TABLE category_id_seq RENAME TO category_cat_id_seq;
ALTER TABLE category ALTER COLUMN cat_id SET DEFAULT nextval('category_cat_id_seq');

ALTER TABLE ipblocks_ipb_id_val RENAME TO ipblocks_ipb_id_seq;
ALTER TABLE ipblocks ALTER COLUMN ipb_id SET DEFAULT nextval('ipblocks_ipb_id_seq');

ALTER TABLE rc_rc_id_seq RENAME TO recentchanges_rc_id_seq;
ALTER TABLE recentchanges ALTER COLUMN rc_id SET DEFAULT nextval('recentchanges_rc_id_seq');

ALTER TABLE log_log_id_seq RENAME TO logging_log_id_seq;
ALTER TABLE logging ALTER COLUMN log_id SET DEFAULT nextval('logging_log_id_seq');

ALTER TABLE pr_id_val RENAME TO page_restrictions_pr_id_seq;
ALTER TABLE page_restrictions ALTER COLUMN pr_id SET DEFAULT nextval('page_restrictions_pr_id_seq');
Comment 9 Chad H. 2011-03-22 13:15:37 UTC
Issue seems fixed except for 8.1, but we've dropped support for that with 1.17.

Going ahead and marking FIXED.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links