Re: [HACKERS] Add function dependencies

2011-01-13 Thread Joel Jacobson
Thanks to the new pg_stat_xact_user_functions and pg_stat_xact_user_tables views in 9.1, it will be possible to automatically "sample" which functions uses which functions/tables to generate a nice directional graph of the dependency tree, based on recent real-life activity, excluding any unused re

Re: [HACKERS] Add function dependencies

2011-01-13 Thread Dimitri Fontaine
Tom Lane writes: > That seems pretty silly/broken. You should only be touching *direct* > dependencies of the extension, IMO. If there's something that's missed > by that algorithm, the way to fix it is to add more direct dependencies > at extension creation time; not to start a tree walk that i

Re: [HACKERS] Add function dependencies

2011-01-12 Thread Tom Lane
Dimitri Fontaine writes: > Peter Eisentraut writes: >> What's a "not-to-follow dependency"? > In case of extensions the code follows dependencies to walk on all > objects. That seems pretty silly/broken. You should only be touching *direct* dependencies of the extension, IMO. If there's somet

Re: [HACKERS] Add function dependencies

2011-01-12 Thread Dimitri Fontaine
Peter Eisentraut writes: > What's a "not-to-follow dependency"? In case of extensions the code follows dependencies to walk on all objects. We already have the problem that an extension depending on another is not relocatable, because 'ALTER EXTENSION SET SCHEMA' would walk to objects of another

Re: [HACKERS] Add function dependencies

2011-01-11 Thread Peter Eisentraut
On tis, 2011-01-11 at 16:57 +0100, Dimitri Fontaine wrote: > Peter Eisentraut writes: > > Making it work for language SQL would be nice, though. > > Please consider a new DEPENDENCY_XXX constant for that though, because > otherwise I think it could cause problems in the extension's dependency > t

Re: [HACKERS] Add function dependencies

2011-01-11 Thread Dimitri Fontaine
Peter Eisentraut writes: > Making it work for language SQL would be nice, though. Please consider a new DEPENDENCY_XXX constant for that though, because otherwise I think it could cause problems in the extension's dependency tracking. Even with a new DEPENDENCY_FUNCALL or other constant, the ext

Re: [HACKERS] Add function dependencies

2011-01-11 Thread Peter Eisentraut
On mån, 2011-01-10 at 23:59 +0100, Joel Jacobson wrote: > It would be equally useful if it warned you when trying to drop a > function other functions might depend on. This would only work for a small subset of cases, so the argument can be made that it is less surprising to say, we don't track de

[HACKERS] Add function dependencies

2011-01-10 Thread Joel Jacobson
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 u