I have created pg_trgm extension in postgres. Application works fine for querying for several days. But after few days, gives an error ERROR: operator does not exist: character varying % text Hint: No operator matches the given name and argument types. You might need to add explicit type casts. When dropping the extension and recreating, then everything works smooth.
What goes wrong not able to get? Is there a permanent solution so that I didn't need to create the extension again and again?
Either you didn't create the extension
pg_trgmin that database, or you created it in a schema that is not on thesearch_pathactive for the query.You can also schema-qualify an operator: