[bug] Fix mod_tags_similar in postgres. Fixes #4846