def METHOD_NAME(self):
    extension = self._trgm_extension_exists()
    if extension == "missing":
        _logger.warning(
            "To use pg_trgm you have to install the postgres-contrib module."
        )
    elif extension == "uninstalled":
        if self._is_postgres_superuser():
            self.env.cr.execute("CREATE EXTENSION IF NOT EXISTS pg_trgm;")
            return True
        else:
            _logger.warning(
                "To use pg_trgm you have to create the "
                "extension pg_trgm in your database or you "
                "have to be the superuser."
            )
    else:
        return True
    return False