Is there a way to find out the name of the calling function in PL / PgSQL?

When I call a PL / PgSQL function (not a trigger) from another such function, is it possible to find out the name or some identifier of the calling function?

0


a source to share


1 answer


this is close as you get and it won't 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 a feature request, including the use case you want to know this information.

+1


a source