https://bugzilla.wikimedia.org/show_bug.cgi?id=51441
--- Comment #1 from basti <[email protected]> --- I have found the error, but I don't know how to solve it. There is a Problem with the Postgres "serach Path" in the plugin. On the database site there is only one schema "mediawiki". The $wgDBuser has the default schema "mediawiki" on server site. (Use "SHOW search_path;" in SQL console to check this.) $wgDBmwschema = "mediawiki"; and $wgDBtype = "postgres"; are also set in LocalSettings.php The Wiki-DEBUG output say "Schema "mediawiki" already in the search path". There is always the same Error on Database site: SELECT COUNT(*) AS VoteCount FROM "Vote" WHERE vote_page_id = '0' Postgres log: FEHLER: Relation »Vote« existiert nicht LINE 1: ...Vote::count Admin */ COUNT(*) AS VoteCount FROM "Vote" WH... ^ “. (in english: Relation »Vote« does not exist) When i change in VoteNY/VoteClass.php it runs. function UserAlreadyVoted() { $dbr = wfGetDB( DB_SLAVE ); $s = $dbr->selectRow( # Here add Postgres schema 'mediawiki.vote', array( 'vote_value' ), array( 'vote_page_id' => $this->PageID, 'username' => $this->Username ), __METHOD__ ); # Exit for debug exit("UserAlreadyVoted() done"); if( $s === false ) { return false; } else { return $s->vote_value; } } I have done also some changes in VoteNY/Hooks.php public static function addTable( $updater ) { $dir = dirname( __FILE__ ); /** change to use Postgres **/ $dbr = wfGetDB( DB_SLAVE ); if ($dbr->getType() == "postgres") { $file = "$dir/vote.postgres.sql"; } else { $file = "$dir/vote.sql"; } /** check if table exists, else the update.php won't run because Postgres exit with Error **/ if (!$dbr->tableExists('vote')) { $updater->addExtensionUpdate( array( 'addTable', 'Vote', $file, true ) ); } /** end of changes **/ return true; } vote.postgres.sql -- Postgres Version -- set Schemata for debug, normally done by includes/db/DatabasePostgres.sql ? SET search_path = mediawiki; CREATE TABLE vote ( -- Internal ID to identify between different vote tags on different pages vote_id SERIAL NOT NULL PRIMARY KEY, -- Username (if any) of the person who voted username varchar(255) NOT NULL default '0', -- User ID of the person who voted vote_user_id integer NOT NULL default '0', -- ID of the page where the vote tag is in vote_page_id integer NOT NULL default '0', -- Value of the vote (ranging from 1 to 5) vote_value char(1) NOT NULL default '', -- Timestamp when the vote was cast vote_date timestamp without time zone NOT NULL, -- IP address of the user who voted vote_ip varchar(45) NOT NULL default '' ) /*$wgDBTableOptions*/; CREATE INDEX vote_page_id_index ON vote (vote_page_id); CREATE INDEX valueidx ON vote (vote_value); CREATE INDEX usernameidx ON vote (username); CREATE INDEX vote_date ON vote (vote_date); --EOF So it seems that includes/db/DatabasePostgres.sql isn't use by this Plugin or something else is goning wrong that the database connection don't know anything about the schema. Regards, basti -- You are receiving this mail because: You are on the CC list for the bug. _______________________________________________ Wikibugs-l mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/wikibugs-l
