Last modified: 2007-03-08 02:00:52 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 Backtrace: #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}
Reassigning to werdna: looks like r19095 introduced the column to Article.php but not to the schema.
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.
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)
I've named the keys for clearity and added a unique index pr_pagetype for postgres.
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 clause.
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.
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
please try r20218, that should contain a working fix.
yes, now it works! Thanks a lot!