Is there a way to know the name of a calling function in PL/PgSQL?
-
21-08-2019 - |
Question
When I call a PL/PgSQL function (not a trigger) from another such function, is it possible to know the name or some kind of ID of a calling function?
Solution
this is a close as you will get, and it wont work in nested calls.
select current_query from pg_stat_activity where procpid = pg_backend_pid();
You might want to email pgsql-hackers@postgresql.org with a feature request, including the use case you have for wanting to know this information.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow