dblayeroo : Manage the GROUP_CONCAT in PgSQL without error of casting

git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@4289 bf3deb0d-5f1a-0410-827f-c0cc1f45334c
This commit is contained in:
2018-07-15 15:49:57 +00:00
parent 0914b4afab
commit e5c67e779e
2 changed files with 52 additions and 12 deletions

View File

@@ -1621,6 +1621,17 @@ class dblayeroo
if (! isset ($func))
$this->displayColumn[$getSortOrder] =
$distinct.$this->sep.$fieldName.$this->sep;
elseif ($func === "string_agg")
{
// For Postgres, the entry must be :
// string_agg(distinct "group"::character varying, ',' order by "group")
if ($separator == "")
$separator = ", ','";
$this->displayColumn[$getSortOrder] =
"$func($distinct$this->sep$fieldName$this->sep".
"::character varying$separator ".
"order by $this->sep$fieldName$this->sep)";
}
else
$this->displayColumn[$getSortOrder] =
"$func($distinct$this->sep$fieldName$this->sep$separator)";