After reading a tip to write string matching function using regexp, directly from postgresql.org, I wondered if that's exactly what I need.
I need to match a keyword with every record on table tag_tags (i.e. tags pkg)
POSIX-style regular expressions is the approach I've written so far.
Is there any better option?
https://www.postgresql.org/docs/9.3/functions-matching.html
Tip: If you have pattern matching needs that go beyond this, consider writing a user-defined function in Perl or Tcl.
There are three separate approaches to pattern matching provided by PostgreSQL: the traditional SQL LIKE operator, the more recent SIMILAR TO operator (added in SQL:1999), and POSIX-style regular expressions. Aside from the basic "does this string match this pattern?" operators, functions are available to extract or replace matching substrings and to split a string at matching locations.