Files
postgresql-for-wordpress/pg4wp
Kevin Locke 55a671b9f7 [nextgen-gallery] Convert GROUP_CONCAT() to STRING_AGG()
PostgreSQL does not support the MySQL GROUP_CONCAT() aggregation
function.  This results in errors such as:

Error running :
SELECT DISTINCT wp_ngg_gallery.* , GROUP_CONCAT(CONCAT_WS('@@', meta_key, meta_value)) AS `extras` FROM `wp_ngg_gallery` LEFT OUTER JOIN `wp_postmeta` ON `wp_postmeta`.`post_id` = `extras_post_id`  GROUP BY wp_ngg_gallery.gid ORDER BY `gid` ASC LIMIT 25
---- converted to ----
SELECT DISTINCT wp_ngg_gallery.* , GROUP_CONCAT(CONCAT_WS('@@', meta_key, meta_value)) AS extras FROM wp_ngg_gallery LEFT OUTER JOIN wp_postmeta ON wp_postmeta.post_id = extras_post_id  GROUP BY wp_ngg_gallery.gid ORDER BY gid ASC LIMIT 25
----> ERROR:  function group_concat(text) does not exist
LINE 1: SELECT DISTINCT wp_ngg_gallery.* , GROUP_CONCAT(CONCAT_WS('@...
                                           ^
HINT:  No function matches the given name and argument types. You might need to add explicit type casts.

However, PostgreSQL 9.0 and later provide the STRING_AGG() aggregation
function for the same purpose.  Therefore, replace calls to
GROUP_CONCAT() with STRING_AGG().

Signed-off-by: Kevin Locke <kevin@kevinlocke.name>
2015-06-06 21:48:28 -06:00
..
2014-08-21 16:53:30 +00:00