error during spreadsheet installation with postgres db

Hi
I installed phppgadmin, its working fine. But when I am installing spreadsheet with postgres database connection, it showing warning & error that:

Warning: pg_query() [function.pg-query]: Query failed: ERROR: unrecognized configuration parameter “foreign_key_checks” in C:\wamp\www\dhtmlxSpreadsheet\installer\src\codebase\php\db_postgre.php on line 13

Fatal error: Uncaught exception ‘Exception’ with message ‘Postgre - sql execution failed ERROR: unrecognized configuration parameter “foreign_key_checks”’ in C:\wamp\www\dhtmlxSpreadsheet\installer\src\codebase\php\db_postgre.php:14 Stack trace: #0 C:\wamp\www\dhtmlxSpreadsheet\installer\installer.php(123): PostgreDBDataWrapper->query(‘SET FOREIGN_KEY…’) #1 C:\wamp\www\dhtmlxSpreadsheet\index.php(48): SpreadsheetInstaller->loadDump(‘localhost’, ‘5432’, ‘postgres’, ‘root’, ‘spreadsheetdb’, ‘Postgre’, ‘’) #2 {main} thrown in C:\wamp\www\dhtmlxSpreadsheet\installer\src\codebase\php\db_postgre.php on line 14

Please suggest.
Thanks.

After initialization, spreadsheet will try to create initial db structure, which seems failing in your case. Check spreadsheet/installer folder, there must be spreadsheet.sql file - just remove from it ( SET FOREIGN_KEY_CHECKS lines )

Hi,
Thanks for suggestion.
I removed the line “SET FOREIGN_KEY_CHECKS=0;” but that sql file is wriiten for mysql and I installed postgres database. so, do I need to place another sql script file for postgres at the same place? If yes, where did I find that script file and is it available in Download section??
Please suggest.
Thanks

Unfortunately we have not it for now
I will post it here as it will be available

ok. Please do let me know.
Thanks

Hi,
I have written a postgresql script by my own and installed dhtmlx spreadsheet.It shows no error. but after installation its showing blank page.
In php log file it shows:
No operator matches the given name and argument type(s). You might need to add explicit type casts. in C:\wamp\www\dhtmlxSpreadsheet_v20\codebase\php\db_postgre.php on line 13 [24-Apr-2013 15:38:44] PHP Fatal error: Uncaught exception ‘Exception’ with message 'Postgre - sql execution failed
ERROR: operator does not exist: character varying LINE 1: SELECTkeyFROM sheet WHERE sheetid='1' ^ HINT: No operator matches the given name and argument type(s). You might need to add explicit type casts.' in C:\wamp\www\dhtmlxSpreadsheet_v20\codebase\php\db_postgre.php:14 Stack trace: #0 C:\wamp\www\dhtmlxSpreadsheet_v20\codebase\php\grid_cell_connector.php(224): PostgreDBDataWrapper->query('SELECTkeyFR...') #1 C:\wamp\www\dhtmlxSpreadsheet_v20\codebase\php\grid_cell_connector.php(55): GridCellConnector->check_key() #2 C:\wamp\www\dhtmlxSpreadsheet_v20\codebase\php\grid_cell_connector.php(39): GridCellConnector->get_data() #3 C:\wamp\www\dhtmlxSpreadsheet_v20\codebase\php\data.php(31): GridCellConnector->render() #4 {main} thrown in C:\wamp\www\dhtmlxSpreadsheet_v20\codebase\php\db_postgre.php on line 14 [24-Apr-2013 15:38:53] PHP Warning: pg_query() [<a href='function.pg-query'>function.pg-query</a>]: Query failed: ERROR: operator does not exist: character varying

Hi,
sorry for the delay in answerring.
It looks like a bug. I’ll check it.

Hi,
First I had many issues to install the spreadsheet using postgres. I had to rewrite the .sql file, and many other small changes. My last issue was the one with the key. I fix it by removing this char ` from all sql queries.
Then go to:

codebase/php/db_postgre.php and modify the method: query($sql)

And you could replace with mine

public function query($sql){
	LogMaster::log($sql);
	
	$sql = str_replace('&quot;', '', $sql);

	if($sql != 'SET FOREIGN_KEY_CHECKS=0'){
	    //clean sql
	    $sql = str_replace('`', '', $sql);
		$res=pg_query($this->connection,$sql);
		if ($res===false) throw new Exception("Postgre - sql execution failed\n".pg_last_error($this->connection));
	}
	

	
	return $res;
}

I hope this help you :slight_smile:
Bruno Quintana.