Re: Determine the name of the calling function - Mailing list pgsql-novice

From Tom Lane
Subject Re: Determine the name of the calling function
Date
Msg-id 20165.1358466237@sss.pgh.pa.us
Whole thread Raw
In response to Determine the name of the calling function  (Jack Kaufman <jack.kaufman@sanmina.com>)
Responses Re: Determine the name of the calling function  (Jack Kaufman <jack.kaufman@sanmina.com>)
List pgsql-novice
Jack Kaufman <jack.kaufman@sanmina.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


pgsql-novice by date:

Previous
From: Jack Kaufman
Date:
Subject: Determine the name of the calling function
Next
From: Jack Kaufman
Date:
Subject: Re: Determine the name of the calling function