postgres syntax problem

This fixes 

    
				SQLSTATE[42P01]: Undefined table: 7 ERROR:  missing FROM-clause entry for table "b" LINE 4:     t2 where t2.bookmark_id = b.id and tag = $2)  ORDER BY l...  ^ at [...]/lib/db.php#1031			

for me - although tags are not filtered. They are just all displayed. 
I must confess that the overall statement uses some sql syntax that I did not see before... So this is more a bug report than a pull request.