Denys
Denys

Reputation: 60

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

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?

Upvotes: 0

Views: 660

Answers (1)

xzilla
xzilla

Reputation: 1161

This is as close as you will get, and it won't work in nested calls.

SELECT current_query();

You might want to email [email protected] with a feature request, including the use case you have for wanting to know this information.

Upvotes: 2

Related Questions