Example:
CREATE OR REPLACE FUNCTION my_schema.my_proc
(
) RETURNS SETOF my_schema.my_table AS $$
BEGIN
RETURN QUERY
SELECT *
FROM my_schema.my_table;
END;
$$ LANGUAGE plpgsql VOLATILE STRICT SECURITY INVOKER;
Appears the parser is not schema aware in this case. The return type generated by the trace drops the schema and postgres is unable to find this type in the public schema.
Example: CREATE OR REPLACE FUNCTION my_schema.my_proc ( ) RETURNS SETOF my_schema.my_table AS $$ BEGIN RETURN QUERY SELECT * FROM my_schema.my_table; END; $$ LANGUAGE plpgsql VOLATILE STRICT SECURITY INVOKER;
Appears the parser is not schema aware in this case. The return type generated by the trace drops the schema and postgres is unable to find this type in the public schema.