Our shop is converting to PostgreSQL & PL/pgSQL and we are figuring out how to apply the language to our environment.I want to write some API functions that will be called from many other functions.I want these APIs to log errors to a table and I would like the table entries to include the name of the function that called the API.Anyway, that's where I'm headed.Thanks for the support.
I've personally wanted to raise debug strings from pl/pgsql function saying what the calling function was (if any) along with other information for similar reasons - it would make debugging a lot easier. Since you likely don't only need the the function name in all cases but relevent details about it such as it's namespace and argument types and probably other things I'm not thinking of it might be easiest to just be able to find out the OID of the caller and do the rest on your own as needed. I wonder if that would be feasible to add.