From 2f8954acb381e5371f30b730d0f266c47de8a69f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Doursenaud?= Date: Wed, 19 Jun 2013 15:49:39 +0200 Subject: [PATCH] Added group_concat equivalent to PgSQL --- htdocs/core/db/pgsql.class.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/htdocs/core/db/pgsql.class.php b/htdocs/core/db/pgsql.class.php index f606dea9c8e37..d8366a0135d83 100644 --- a/htdocs/core/db/pgsql.class.php +++ b/htdocs/core/db/pgsql.class.php @@ -177,6 +177,10 @@ static function convertSQLFromMysql($line,$type='auto',$unescapeslashquot=0) } if ($line != "") { + // group_concat support (PgSQL >= 9.1) + $line = preg_replace('/GROUP_CONCAT/i', 'STRING_AGG', $line); + $line = preg_replace('/ SEPARATOR/i', ',', $line); + if ($type == 'auto') { if (preg_match('/ALTER TABLE/i',$line)) $type='dml';