Bruce Momjian <bruce@momjian.us> writes:
> So you are saying that CREATE OR REPLACE FUNCTION should not preserve
> the SEARCH_PATH. Makes sense to me. Any idea why we coded it this way?
We didn't. For me, it works as expected:
... follow example, \sf after each step
regression=# \sf my_func
CREATE OR REPLACE FUNCTION public.my_func()
RETURNS boolean
LANGUAGE plpgsql
SET search_path TO 'my_schema'
AS $function$ BEGIN RETURN
TRUE;END;$function$
regression=# CREATE OR REPLACE FUNCTION MY_FUNC () RETURNS BOOLEAN AS $$ BEGIN RETURN
regression$# TRUE;END;$$ LANGUAGE PLPGSQL;
CREATE FUNCTION
regression=# \sf my_func
CREATE OR REPLACE FUNCTION public.my_func()
RETURNS boolean
LANGUAGE plpgsql
AS $function$ BEGIN RETURN
TRUE;END;$function$
regards, tom lane