Re: Determine the name of the calling function

Поиск
Список
Период
Сортировка
От Casey Allen Shobe
Тема Re: Determine the name of the calling function
Дата
Msg-id CAFmVg3jO6YZj_G_5oVNKq2J3hg8c_tQu3AEGmLTD8MOg0EBOtw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Determine the name of the calling function  (Jack Kaufman <jack.kaufman@sanmina.com>)
Список pgsql-novice
On Fri, Jan 18, 2013 at 11:28 AM, Jack Kaufman <jack.kaufman@sanmina.com> wrote:

Our shop is converting to PostgreSQL & PL/pgSQL and we are figuring out how to apply the language to our environment.  I want to write some API functions that will be called from many other functions.  I want these APIs to log errors to a table and I would like the table entries to include the name of the function that called the API.  Anyway, that's where I'm headed.  Thanks for the support.

 
I've personally wanted to raise debug strings from pl/pgsql function saying what the calling function was (if any) along with other information for similar reasons - it would make debugging a lot easier.  Since you likely don't only need the the function name in all cases but relevent details about it such as it's namespace and argument types and probably other things I'm not thinking of it might be easiest to just be able to find out the OID of the caller and do the rest on your own as needed.  I wonder if that would be feasible to add.

--
Casey Allen Shobe
casey@shobe.info


В списке pgsql-novice по дате отправления:

Предыдущее
От: Jack Kaufman
Дата:
Сообщение: Re: Determine the name of the calling function
Следующее
От: Daniel Staal
Дата:
Сообщение: Re: Determine the name of the calling function