Browse Source

Fix: no ' on command to create user on pgsql

Laurent Destailleur 11 years ago
parent
commit
dd9a08120f
1 changed files with 2 additions and 1 deletions
  1. 2 1
      htdocs/core/db/pgsql.class.php

+ 2 - 1
htdocs/core/db/pgsql.class.php

@@ -981,7 +981,8 @@ class DoliDBPgsql extends DoliDB
 	 */
 	function DDLCreateUser($dolibarr_main_db_host,$dolibarr_main_db_user,$dolibarr_main_db_pass,$dolibarr_main_db_name)
 	{
-		$sql = "CREATE USER '".$this->escape($dolibarr_main_db_user)."' with password '".$this->escape($dolibarr_main_db_pass)."'";
+		// Note: using ' on user does not works with pgsql
+		$sql = "CREATE USER ".$this->escape($dolibarr_main_db_user)." with password '".$this->escape($dolibarr_main_db_pass)."'";
 
 		dol_syslog(get_class($this)."::DDLCreateUser", LOG_DEBUG);	// No sql to avoid password in log
 		$resql=$this->query($sql);