Last modified: 2007-03-08 02:00:52 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 T11097, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 9097 - column "pr_pagetype" does not exist
column "pr_pagetype" does not exist
Product: MediaWiki
Classification: Unclassified
Database (Other open bugs)
PC Linux
: Normal normal (vote)
: ---
Assigned To: Andrew Garrett
Depends on:
Blocks: postgres
  Show dependency treegraph
Reported: 2007-02-25 16:11 UTC by Mathias Behrle
Modified: 2007-03-08 02:00 UTC (History)
2 users (show)

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


Description Mathias Behrle 2007-02-25 16:11:35 UTC
Running a fresh install of 1.10A (SVN) on PostgreSQL I get the following error.
Creating the column with type text works for me, so I am assuming this is caused
by a liitle bit outdated table definition. Nevertheless I didn't find neither
the definition in /mysql5/tables.sql, so it seems to be a fault in all definitions.

A database error has occurred Query: DELETE FROM page_restrictions WHERE
(pr_pagetype=NULL) Function: Article::updateRestrictions Error: 1 ERROR: column
"pr_pagetype" does not exist


#0 /var/www/phase3/includes/Database.php(672):
DatabasePostgres->reportQueryError('ERROR: column ...', 1, 'DELETE FROM
pag...', 'Article::update...', false)
#1 /var/www/phase3/includes/DatabasePostgres.php(612): Database->query('DELETE
FROM pag...', 'Article::update...')
#2 /var/www/phase3/includes/Article.php(1716):
DatabasePostgres->replace('page_restrictio...', Array, Array,
'Article::update...') #3 /var/www/phase3/includes/ProtectionForm.php(169):
Article->updateRestrictions(Array, '', false, 'infinity')
#4 /var/www/phase3/includes/ProtectionForm.php(79): ProtectionForm->save()
#5 /var/www/phase3/includes/Article.php(1637): ProtectionForm->execute()
#6 /var/www/phase3/includes/Wiki.php(376): Article->protect()
#7 /var/www/phase3/includes/Wiki.php(48):
MediaWiki->performAction(Object(StubObject), Object(Article), Object(Title),
Object(User), Object(WebRequest)) #8 /var/www/phase3/index.php(48):
MediaWiki->initialize(Object(Title), Object(StubObject), Object(User),
Object(WebRequest)) #9 {main}
Comment 1 Greg Sabino Mullane 2007-02-25 16:52:54 UTC
Reassigning to werdna: looks like r19095 introduced the column to Article.php
but not to the schema.
Comment 2 Aaron Schulz 2007-02-25 20:51:37 UTC
pr_pagetype is an unnamed key, so it basically acts as a contraint, however, in
article.php its being used as an index, which seems to confuse PostgreSQL.
Comment 3 Aaron Schulz 2007-02-25 20:55:31 UTC
To be more clear, I mean to say that line:

PRIMARY KEY (pr_page,pr_type)

Should probably be:

PRIMARY KEY pr_pagetype (pr_page,pr_type)
Comment 4 Aaron Schulz 2007-02-25 21:39:23 UTC
I've named the keys for clearity and added a unique index pr_pagetype for postgres.
Comment 5 Mathias Behrle 2007-02-26 11:14:44 UTC
Since pr_pagetype appears in the WHERE clause, defining as an index cannot be
the final solution. It should be a real column or not appear at all in the WHERE
Comment 6 River Tarnell 2007-03-07 22:59:39 UTC
fixed in r20216.  the problem was that the uniqueindexes parameter to replace() is meant to contain an array of the column names that are considered 
unique in the replace operation, not the index used to determine uniqueness.
Comment 7 Mathias Behrle 2007-03-08 01:31:34 UTC
Sorry for insisting once again:
the SQL error is gone, but on updating table page_restrictions (inserting a new
record) all old records are deleted
Comment 8 River Tarnell 2007-03-08 01:46:33 UTC
please try r20218, that should contain a working fix.
Comment 9 Mathias Behrle 2007-03-08 02:00:52 UTC
yes, now it works! Thanks a lot!

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