Easy way to find out what tag groups a tag is belonging?

I have a tag that had only administration meaning. Earlier I showed it to every users, but it is basically just noise for them and no one except me was using it.

So I added it to tag group that is visible only for admins. But it was still visible to everyone. First I was thrilled because I found a bug… but no. Only bug was, again, I.

I’ve listed that tag in three other groups too and those were visible to everyone. The tag was hided from ordinary users when I cleaned it away from those other groups, but finding those ”overlapping” tag groups needed too much manual labour :woozy_face:

So, is there an easy way to find out in what groups a tag is added?

SQL of course, but I don’t speak it. And when I asked advise from chatbot I wasn’t specific enough, I reckon.

I think it tells you on the tag page using the tag wrench(/info button, if a non-staff user):

2 Likes

Oh for are f-words allowed here sake — how clueless a man can be :man_facepalming: I should knew that, but when I was on tag-page I never ever thought that road. A good example of limited thinking.

Well, that’s enough self-punishment for today :stuck_out_tongue_winking_eye:

But… you can SQL and I bet you can talk to AI better than me. Do we have ability to ask that from the database? And that is pure curiosity, not a need anymore.

1 Like

A query that lists tags and has a column of all their associated tag groups?

That should be possible with something like this:

SELECT 
    t.name AS "Tag",
    STRING_AGG(tg.name, ', ' ORDER BY tg.name) AS "Tag Groups"
FROM tags t
  JOIN tag_group_memberships tgm ON tgm.tag_id = t.id
  JOIN tag_groups tg ON tg.id = tgm.tag_group_id
GROUP BY t.name
4 Likes

That’s good starting point. Thanks!

2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.