It looks like the parser don't detect schemas, functions, variables, ... inside following statements: PERFORM RETURN IF ELSE CASE EXCEPTION EXECUTE Maybe there are more statements and element types. If I detect them, then the list will be updated. I have tried to write one function with all problems. Example (screenshot) Example (for copy and paste) CREATE OR REPLACE FUNCTION public.test( IN in_test CHARACTER VARYING) RETURNS CHARACTER VARYING AS $$ DECLARE temp_test CHARACTER VARYING; BEGIN -- Both variables, will be correct detected there: SELECT t1.* INTO temp_test FROM table1 AS t1 WHERE (t1.test = in_test); -- All following statements will be not parsed, -- and variables will not be highlighted: -- EXECUTE EXECUTE 'SET abc.test = ' || quote_literal(in_test) || ';'; -- IF and ELSE IF (in_test = 'test') THEN RETURN temp_test; ELSE SELECT t1.* INTO temp_test FROM table1 AS t1 WHERE (t1.test = in_test); END IF; -- CASE CASE temp_test WHEN 'test1' THEN RETURN temp_test; END CASE; -- EXCEPTION BEGIN RAISE division_by_zero; EXCEPTION WHEN division_by_zero THEN temp_test = NULL; END; -- PERFORM PERFORM public.test2(temp_test); -- RETURN RETURN temp_test; END; $$ LANGUAGE plpgsql VOLATILE LEAKPROOF STRICT SECURITY DEFINER COST 100;
↧