Re: BUG #15993: "CREATE OR REPLACE FUNCTION" does not clear search_path - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #15993: "CREATE OR REPLACE FUNCTION" does not clear search_path
Date
Msg-id 16367.1569606999@sss.pgh.pa.us
Whole thread Raw
In response to Re: BUG #15993: "CREATE OR REPLACE FUNCTION" does not clearsearch_path  (Bruce Momjian <bruce@momjian.us>)
List pgsql-bugs
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



pgsql-bugs by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: erro in Instaling PostegreSQL 11
Next
From: Andres Freund
Date:
Subject: Re: BUG #15929: logical decoding can not write down the analyseresult when the output file is touched.