Add function dependencies

From: Joel Jacobson <joel(at)gluefinance(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Add function dependencies
Date: 2011-01-10 22:59:48
Message-ID: AANLkTikdBBJ1kaRKi=HK-YXkBQn2MyQ2Ju+t9bYme0w-@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Lukas Eder 2011-01-10 23:06:31 Weird issues when reading UDT from stored function
Previous Message Kevin Grittner 2011-01-10 22:56:06 Re: Compatibility GUC for serializable