> 2013/12/9 Amit Kapila <amit.kapila16@gmail.com> >> >> > >> > There are two points, that should be solved >> > >> > a) introduction a dependency to other object in schema - now CREATE >> > FUNCTION >> > is fully independent on others >> > >> > b) slow start - if we check all paths on start, then start can be slower >> > - >> > and some functions should not work due dependency on temporary tables. >> > >> > I am thinking about possible marking a function by #option (we have same >> > idea) >> > >> > some like >> > >> > #option check_on_first_start >> > #option check_on_create >> > #option check_newer >> >> what exactly check_newer means, does it mean whenever a function is >> replaced (changed)? >> > > no, it means, so request for check will be ignored ever - some functions > cannot be deeply checked due using dynamic SQL or dynamic created data types > - temporary tables created in functions.
Thanks for clarification, the part of name 'newer' has created confusion. I understand that creating/identifying dependency in some of the cases will be quite tricky, does other similar languages for other databases does that for all cases (objects in dynamic statements).
I am sorry
PL/pgSQL is really specific due invisible SQL base and mixing two environments and languages in user visible area.
Is the main reason for identifying/creating dependency is to mark function as invalid when any dependent object is Dropped/Altered?
Now, PG has no any tool for checking dependency between functions and other objects. What has positive effects - we have very simply deploying, that works in almost use cases very well - and works with our temporary tables implementation. There is simple rule - depended object must living before they are >>used in runtime<<. But checking should not be runtime event and we would to decrease a false alarms. So we have to expect so almost all necessary object are created - it is reason, why we decided don't do check in create function statement time. We don't would to introduce new dependency if it will be possible.
Regards
Pavel
This thread is from quite some time, so please excuse me if I had asked anything which has been discussed previously.