database install problem

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

database install problem

laurasmous
Hi,

I am unable to successfully complete the database initialization on the following install:

    *  MediaWiki: 1.10.0
    * PHP: 5.1.6-pl6-gentoo (apache2handler)
    * PostgreSQL: PostgreSQL 8.1.5 on i686-pc-linux-gnu, compiled by GCC i686-pc-linux-gnu-gcc (GCC) 4.1.1 (Gentoo 4.1.1-r3)

I receive the errors below.  The mediawiki user is a superuser and should have all the permissions it needs to do this.  Is there any other way to run the DB updates?

Thank you!
Laura

Warning: pg_query() [function.pg-query]: Query failed: ERROR: syntax error at or near "FROM" at character 40 in /var/www/localhost/htdocs/wiki/includes/DatabasePostgres.php on line 496
Internal error

A database error has occurred Query: SHOW INDEX FROM smw_relations Function: SMW::SetupIndex Error: 1 ERROR: syntax error at or near "FROM" at character 40

Backtrace:

#0 /var/www/localhost/htdocs/wiki/includes/Database.php(761): DatabasePostgres->reportQueryError('ERROR: syntax ...', 1, 'SHOW INDEX FROM...', 'SMW::SetupIndex', false)
#1 /var/www/localhost/htdocs/wiki/extensions/SemanticMediaWiki/includes/storage/SMW_SQLStore.php(641): Database->query('SHOW INDEX FROM...', 'SMW::SetupIndex')
#2 /var/www/localhost/htdocs/wiki/extensions/SemanticMediaWiki/includes/storage/SMW_SQLStore.php(521): SMWSQLStore->setupIndex('smw_relations', 'subject_id', Object(DatabasePostgres))
#3 /var/www/localhost/htdocs/wiki/extensions/SemanticMediaWiki/specials/SMWAdmin/SMW_SpecialSMWAdmin.php(42): SMWSQLStore->setup()
#4 /var/www/localhost/htdocs/wiki/includes/SpecialPage.php(627): doSpecialSMWAdmin(NULL, Object(SpecialPage))
#5 /var/www/localhost/htdocs/wiki/includes/SpecialPage.php(433): SpecialPage->execute(NULL)
#6 /var/www/localhost/htdocs/wiki/includes/Wiki.php(196): SpecialPage::executePath(Object(Title))
#7 /var/www/localhost/htdocs/wiki/includes/Wiki.php(45): MediaWiki->initializeSpecialCases(Object(Title), Object(OutputPage), Object(WebRequest))
#8 /var/www/localhost/htdocs/wiki/index.php(89): MediaWiki->initialize(Object(Title), Object(OutputPage), Object(User), Object(WebRequest))
#9 {main}

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Semediawiki-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/semediawiki-user
Reply | Threaded
Open this post in threaded view
|

Re: database install problem

S Page
[hidden email] wrote:

> I am unable to successfully complete the database initialization on the following install:
>
>     *  MediaWiki: 1.10.0
>     * PHP: 5.1.6-pl6-gentoo (apache2handler)
>     * PostgreSQL: PostgreSQL 8.1.5 on i686-pc-linux-gnu, compiled by GCC i686-pc-linux-gnu-gcc (GCC) 4.1.1 (Gentoo 4.1.1-r3)

As the INSTALL document says, SMW 0.7 requires
        MySQL >= 4.0.14
and you've discovered an incompatibility with Postgres.

setupIndex() is checking for an index, and "SHOW INDEX FROM $table" is
the way to do it in MySQL, but it seems incompatible with PostgreSQL.


This sounds like the first time you've set up SMW, so if you have slight
experience with editing PHP (like me ;-) ) you could try commenting out
that check.  In
extensions/SemanticMediaWiki/includes/storage/SMW_SQLStore.php, comment
out the 18 or so lines in function setupIndex() by prepending
    ## Disable for Postgres
until the only active lines are:
    $db->query( "ALTER TABLE $table ADD INDEX ( `$column` )", $fname );
    return true;

then see how much further you get.  You might run straight into other
bits of MySQL-specific code.



If you're more expert, I'm sure the developers would welcome patches and
assistance in supporting Postgres.

I compared Mediawiki's indexInfo() function in Database.php and
DatabasePostgres.php, and perhaps the PostgreSQL equivalent is
        SELECT indexname FROM pg_indexes WHERE tablename='$table'


SMW could almost call MediaWiki's wfIndexExists() wrapper function or
indexInfo() and avoid database-specific code here.  But SMW is ensuring
there's a single index on a column, going so far as to drop duplicate
indices, and I don't see a MediaWiki database function for that.

Regards,
--
=S Page

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Semediawiki-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/semediawiki-user