Permalink
Browse files

Merge pull request #76 from suraia/fix-filtering-postgresql

Fix filtering by tag for PostgreSQL
  • Loading branch information...
jancborchardt committed Jul 29, 2014
2 parents 0395ced + d0916c1 commit 793733479a4669bdc49b7ba57a605551f03d7929
Showing with 3 additions and 3 deletions.
  1. +3 −3 lib/bookmarks.php
View
@@ -88,9 +88,9 @@ public static function findBookmarks($offset, $sqlSortColumn, $filters, $filterT
$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`

0 comments on commit 7937334

Please sign in to comment.