When I create a function and set the search_path to '' and then run the plan I see the output showing search_path with "" instead. When I run the apply this fails as that is the wrong delimiter to use. It also seems like the namespaces aren't qualifying too when I set the search_path to say pg_temp, the namespaces get stripped from the function.
Table creation snippet:
create table public.test (
id bigint generated by default as identity not null,
title text null,
created_at timestamp with time zone not null default now(),
constraint test_pkey primary key (id)
);
Here is an example function:
CREATE OR REPLACE FUNCTION create_hello(p_title text)
LANGUAGE plpgsql
SECURITY INVOKER
SET search_path = ''
AS $$
BEGIN
INSERT INTO public.test (title) VALUES (p_title)
RETURNING id;
END;
$$;
I am expecting the example function to remain as it is with '' for the value of search_path, but instead it is showing as:
CREATE OR REPLACE FUNCTION create_hello(p_title text)
LANGUAGE plpgsql
SECURITY INVOKER
SET search_path = ""
AS $$
BEGIN
INSERT INTO test (title) VALUES (p_title)
RETURNING id;
END;
$$;
after a plan or apply.
edit: updated the snippet to remove public. from test in the current output.
When I create a function and set the search_path to '' and then run the plan I see the output showing search_path with "" instead. When I run the apply this fails as that is the wrong delimiter to use. It also seems like the namespaces aren't qualifying too when I set the search_path to say
pg_temp, the namespaces get stripped from the function.Table creation snippet:
Here is an example function:
I am expecting the example function to remain as it is with
''for the value ofsearch_path, but instead it is showing as:after a
planorapply.edit: updated the snippet to remove
public.fromtestin the current output.