Instead, I plan to expect the function to receive a query string that will get the data that is being processed by the function.
That query string should be allowed to refer to tables in the search_path at the caller's side.
Therefore, I cannot use the "SET search_path FROM CURRENT" in my "CREATE FUNCTION" statement, because it would overwrite the current search_path on each call of the function.
I wonder if it would help if EXECUTE took an optional search_path to use while executing the query.