Determine the name of the calling function

From: Jack Kaufman <jack(dot)kaufman(at)sanmina(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: Determine the name of the calling function
Date: 2013-01-17 22:53:58
Message-ID: CAM=VM82+eTqLsLDG=bcO5-dY3MtX1Q+5VGTZjrGPKE1_y8LKpw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Postgres 9.2 / pgAdmin III

Linux / Windows XP

Hello,

Within a sub-function, I would like to programmatically determine the name
of the calling function.

In a previous programming language, I could call a special built-in
function, PROGRAM(n), where n=1 would return the name of the calling
program; n=2, the name of the program above that; and so on up the stack.

I've tried out all the special variables associated with "GET STACKED
DIAGNOSTICS" statement; but I don't see a way to get the name of the
calling program. And I don’t find this information anywhere else in the
PostgreSQL documentation.

How do I programmatically determine, from a sub-function, the name of the
calling function?

Thank you, Jack

--
Jack Kaufman
MDS Application Devl (US)
Sanmina-SCI Corporation - Owego site
Email: jack(dot)kaufman(at)sanmina(dot)com
Skype: jack_kaufman_sanm
607-723-0507

CONFIDENTIALITY
This e-mail message and any attachments thereto, is intended only for use by the addressee(s) named herein and may contain legally privileged and/or confidential information. If you are not the intended recipient of this e-mail message, you are hereby notified that any dissemination, distribution or copying of this e-mail message, and any attachments thereto, is strictly prohibited. If you have received this e-mail message in error, please immediately notify the sender and permanently delete the original and any copies of this email and any prints thereof.
ABSENT AN EXPRESS STATEMENT TO THE CONTRARY HEREINABOVE, THIS E-MAIL IS NOT INTENDED AS A SUBSTITUTE FOR A WRITING. Notwithstanding the Uniform Electronic Transactions Act or the applicability of any other law of similar substance and effect, absent an express statement to the contrary hereinabove, this e-mail message its contents, and any attachments hereto are not intended to represent an offer or acceptance to enter into a contract and are not otherwise intended to bind the sender, Sanmina Corporation (or any of its subsidiaries), or any other person or entity.

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Tom Lane 2013-01-17 23:43:57 Re: Determine the name of the calling function
Previous Message Gavan Schneider 2013-01-17 00:26:59 Re: Does psql evaluate OR conditions in order?