Add function dependencies - Mailing list pgsql-hackers

From Joel Jacobson
Subject Add function dependencies
Date
Msg-id AANLkTikdBBJ1kaRKi=HK-YXkBQn2MyQ2Ju+t9bYme0w-@mail.gmail.com
Whole thread Raw
Responses Re: Add function dependencies  (Peter Eisentraut <peter_e@gmx.net>)
List pgsql-hackers
When a function is created, the system validates the syntax and
complains if any function the created function attempts to call is
missing.
I think this is really good, since it traps typos and warns you if you
have forgotten to install any functions your function depends on.

It would be equally useful if it warned you when trying to drop a
function other functions might depend on.

Currently, I do something like SELECT * FROM pg_proc WHERE prosrc LIKE
'%myfunc%' to verify nothing is using the function I'm about to drop.

Just like you can disable the creation check by setting
check_function_bodies to false,
I would suggest a similar option to disable the check upon dropping
functions, to disable the suggested dependency check.

Additionally, if pg_depend would reveal function dependencies, it
would be trivial to automatically generate function call digraphs in
.dot format, showing a nice call tree of your entire system.

-- 
Best regards,

Joel Jacobson
Glue Finance


pgsql-hackers by date:

Previous
From: "Kevin Grittner"
Date:
Subject: Re: Compatibility GUC for serializable
Next
From: Shigeru HANADA
Date:
Subject: Re: SQL/MED - file_fdw