From: Tom Lane <tgl@sss.pgh.pa.us>
To: Bruce Momjian <bruce@momjian.us>
Cc: alexander.pavlov.rus@gmail.com
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #15993: "CREATE OR REPLACE FUNCTION" does not clear search_path
Date: Fri, 27 Sep 2019 13:56:39 -0400
Message-ID: <16367.1569606999@sss.pgh.pa.us> (raw)
In-Reply-To: <20190927173241.GI31412@momjian.us>
References: <15993-a0c0026150beb40a@postgresql.org>
<20190927173241.GI31412@momjian.us>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: tgl@sss.pgh.pa.us, bruce@momjian.us, alexander.pavlov.rus@gmail.com
Subject: Re: BUG #15993: "CREATE OR REPLACE FUNCTION" does not clear search_path
In-Reply-To: <16367.1569606999@sss.pgh.pa.us>
References: <15993-a0c0026150beb40a@postgresql.org> <20190927173241.GI31412@momjian.us> <16367.1569606999@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox