I have an issue where I am unable to make a cross-schema function call because of that function's use of PostGIS. I have both PostGIS and my function in the public schema, but I'm trying to call the function from my ORM which, by necessity, is pointed at another schema. I am able to reference the function by using SELECT * FROM public.functionName, but the function execution fails when it reaches PostGIS-relevant functions like ST_MakeLine. What is the best solution in this case, move PostGIS and my function out of public? Edit the function itself to call public.PostGISFunction? Something else entirely?


1 Answer 1


The issue is with the search path. As suggested by @JohnPowell, you would need to make sure the user has public in its search path.

Alternatively, you could use add a configuration at the function level to add public to the search path of the function:

CREATE OR REPLACE FUNCTION public.mysuperfunction() RETURNS integer AS

    -- Set path as Postgis needs public but user doesn't have access
    SET search_path = public;

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.