diff --git a/lib/dmllib.php b/lib/dmllib.php index f754f4dc2f3..abd66aed467 100644 --- a/lib/dmllib.php +++ b/lib/dmllib.php @@ -1666,9 +1666,14 @@ function sql_fullname($firstname='firstname', $lastname='lastname') { * @return string */ function sql_concat() { - global $db; + global $db, $CFG; $args = func_get_args(); +/// PostgreSQL requires at least one char element in the concat, let's add it +/// here (at the beginning of the array) until ADOdb fixes it + if ($CFG->dbfamily == 'postgres' && is_array($args)) { + array_unshift($args , "''"); + } return call_user_func_array(array($db, 'Concat'), $args); }