pgspot
pgspot copied to clipboard
Make tracking of object creation and search_path optional
Since we don't do control flow analysis our object creation tracking can mask potential problems and produce false negatives. The following snippet would not produce a warning about unsafe function creation even though it should since the first CREATE FUNCTION
would never execute making the 2nd CREATE OR REPLACE
unsafe.
DO $$
BEGIN
IF false THEN
CREATE FUNCTION f1() RETURNS int LANGUAGE SQL AS $w2$ SELECT 1; $w2$;
END IF;
END; $$;
CREATE OR REPLACE FUNCTION f1() RETURNS int LANGUAGE SQL AS $$ SELECT 1; $$;