Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make tracking of object creation and search_path optional #45

Open
svenklemm opened this issue Apr 24, 2022 · 0 comments
Open

Make tracking of object creation and search_path optional #45

svenklemm opened this issue Apr 24, 2022 · 0 comments

Comments

@svenklemm
Copy link
Member

svenklemm commented Apr 24, 2022

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; $$;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant