[Fusionforge-commits] r14595 - in branches/Branch_5_1: . src/common/include

Roland Mas lolando at fusionforge.org
Mon Oct 10 14:24:08 CEST 2011


Author: lolando
Date: 2011-10-10 14:24:08 +0200 (Mon, 10 Oct 2011)
New Revision: 14595

Modified:
   branches/Branch_5_1/
   branches/Branch_5_1/src/common/include/database-pgsql.php
Log:
Handle setting default FTI config for PostgreSQL < 8.3

Modified: branches/Branch_5_1/src/common/include/database-pgsql.php
===================================================================
--- branches/Branch_5_1/src/common/include/database-pgsql.php	2011-10-10 12:09:40 UTC (rev 14594)
+++ branches/Branch_5_1/src/common/include/database-pgsql.php	2011-10-10 12:24:08 UTC (rev 14595)
@@ -99,11 +99,15 @@
 	define('SYS_DB_TROVE', $gfconn2);
 	define('SYS_DB_SEARCH', $gfconn2);
 
-	if (forge_get_config('use_fti')) {
-		db_query_params ('SELECT set_config($1, $2, false)', 
-				 array('default_text_search_config',
-				       'simple'));
+	$res = db_query_params ('SELECT set_config($1, $2, false)', 
+				array('default_text_search_config',
+				      'simple'));
+	if (!$res) {
+		// Cope with PostgreSQL < 8.3
+		db_query_params ('SELECT set_curcfg($1)', 
+				array('simple'));
 	}
+
 	// Register top-level "finally" handler to abort current
 	// transaction in case of error
 	register_shutdown_function("system_cleanup");




More information about the Fusionforge-commits mailing list