Just wondering if anyone knew how to obtain the schema name of a currently running function.
For example…
CREATE OR REPLACE FUNCTION test.myfunction() RETURNS text AS $$
BEGIN
return function_schema();
END $$ LANGUAGE ‘plpgsql’;
I realize there is “current_schema()” function, but it seems to display the initial schema in the search path, not of the schema of the running function. What I would expect to get is “test”.
Does anyone know a way to obtain this?
What I am trying to accomplish is to be able to port my code to different schemas when the code itself contains schema specific referenced code.
Thanks in advance,
gwinn7
For example…
CREATE OR REPLACE FUNCTION test.myfunction() RETURNS text AS $$
BEGIN
return function_schema();
END $$ LANGUAGE ‘plpgsql’;
I realize there is “current_schema()” function, but it seems to display the initial schema in the search path, not of the schema of the running function. What I would expect to get is “test”.
Does anyone know a way to obtain this?
What I am trying to accomplish is to be able to port my code to different schemas when the code itself contains schema specific referenced code.
Thanks in advance,
gwinn7