1
0
mirror of https://github.com/owncloud/bookmarks.git synced 2024-11-29 04:24:11 +01:00

Fix filtering by tag for PostgreSQL.

This commit is contained in:
Michael Kuhn 2014-07-17 20:43:16 +02:00
parent 0395ced799
commit d0916c196b

View File

@ -88,9 +88,9 @@ class OC_Bookmarks_Bookmarks{
$params=array(OCP\USER::getUser());
if($CONFIG_DBTYPE == 'pgsql') {
$sql = "SELECT * FROM (SELECT *, (select array_to_string(array_agg(`tag`),',') from `*PREFIX*bookmarks_tags` where `bookmark_id` = `b`.`id`) as `tags`
FROM `*PREFIX*bookmarks` `b`
WHERE `user_id` = ? ) as `x` WHERE true ";
$sql = "SELECT * FROM (SELECT *, (select array_to_string(array_agg(`tag`),',') from `*PREFIX*bookmarks_tags` where `bookmark_id` = `b2`.`id`) as `tags`
FROM `*PREFIX*bookmarks` `b2`
WHERE `user_id` = ? ) as `b` WHERE true ";
}
else {
$sql = "SELECT *, (SELECT GROUP_CONCAT(`tag`) from `*PREFIX*bookmarks_tags` WHERE `bookmark_id` = `b`.`id`) as `tags`