Carlos Henrique Reimer <carlos.reimer@opendb.com.br> writes:
> Yes, once correct schema was included in the search_path, VACUUM and ANALYZE
> run fine again.
You'd be better advised to fix the function so it works regardless of
caller's search_path. As-is, it's a loaded gun pointed at your foot.
regards, tom lane