pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: alexander.pavlov.rus@gmail.com
Subject: BUG #15993: "CREATE OR REPLACE FUNCTION" does not clear search_path
Date: Fri, 06 Sep 2019 20:42:02 +0000
Message-ID: <15993-a0c0026150beb40a@postgresql.org> (raw)

The following bug has been logged on the website:

Bug reference:      15993
Logged by:          Alexander Pavlov
Email address:      alexander.pavlov.rus@gmail.com
PostgreSQL version: 10.9
Operating system:   Debian
Description:        

-- this will correctly create function with empty search_path
CREATE OR REPLACE FUNCTION MY_FUNC () RETURNS BOOLEAN AS $$ BEGIN RETURN
TRUE;END;$$ LANGUAGE PLPGSQL;

-- this will correctly update function to have "PUBLIC, MY_SCHEMA" search
path
CREATE OR REPLACE FUNCTION MY_FUNC () RETURNS BOOLEAN AS $$ BEGIN RETURN
TRUE;END;$$ LANGUAGE PLPGSQL SET SEARCH_PATH TO PUBLIC, MY_SCHEMA;

-- this will correctly update function to have "MY_SCHEMA" search path
CREATE OR REPLACE FUNCTION MY_FUNC () RETURNS BOOLEAN AS $$ BEGIN RETURN
TRUE;END;$$ LANGUAGE PLPGSQL SET SEARCH_PATH TO MY_SCHEMA;

-- this will NOT update function to have empty search path, search path will
remain "MY_SCHEMA", as at previous "create or replace" call
CREATE OR REPLACE FUNCTION MY_FUNC () RETURNS BOOLEAN AS $$ BEGIN RETURN
TRUE;END;$$ LANGUAGE PLPGSQL;



view thread (3+ messages)  latest in thread

Message-ID: <15993-a0c0026150beb40a@postgresql.org>
Permalink:  ../15993-a0c0026150beb40a@postgresql.org/
Also on:    postgresql.org/message-id/15993-a0c0026150beb40a@postgresql.org

 · 

reply

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: noreply@postgresql.org, alexander.pavlov.rus@gmail.com
  Subject: Re: BUG #15993: "CREATE OR REPLACE FUNCTION" does not clear search_path
  In-Reply-To: <15993-a0c0026150beb40a@postgresql.org>
  References: <15993-a0c0026150beb40a@postgresql.org>

* 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