PostgreSQL Bugs

Collected from the PG bugs email list.

Bug ID15993
PG Version10.9
OSDebian
Opened2019-09-06 20:42:02+00
Reported byAlexander Pavlov
StatusNew

Body of first available message related to this bug follows.

The following bug has been logged on the website:

Bug reference:      15993
Logged by:          Alexander Pavlov
Email address:      (redacted)
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;

Messages

DateAuthorSubject
2019-09-06 20:42:02+00PG Bug reporting formBUG #15993: "CREATE OR REPLACE FUNCTION" does not clear search_path
2019-09-27 17:32:41+00Bruce MomjianRe: BUG #15993: "CREATE OR REPLACE FUNCTION" does not clear search_path
2019-09-27 17:56:39+00Tom LaneRe: BUG #15993: "CREATE OR REPLACE FUNCTION" does not clear search_path