Jack Kaufman <jack(dot)kaufman(at)sanmina(dot)com> writes:
> How do I programmatically determine, from a sub-function, the name of the
> calling function?
There's not really any built-in way to do that.
If you are sufficiently desperate, I think it'd work to throw an
exception, catch it, and look into the PG_EXCEPTION_CONTEXT text to pull
out the function name the right number of levels up. This is likely to
be expensive though.
regards, tom lane