How to find out who is calling the function

From: "BARTKO Zoltan" <bartko(dot)zoltan(at)pobox(dot)sk>
To: <pgsql-general(at)postgresql(dot)org>
Subject: How to find out who is calling the function
Date: 2004-06-05 05:34:20
Message-ID: 008001c44abe$c0df0720$0e5d10ac@antik.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Dear friends,

I had a look at www.pgsql.ru, looking for how to find out what user is calling the function - from inside the function. No luck.

Could someone enlighten me:

I have a stored function. I want to do the following:

if caller() = ''userA'' then
return -1; -- error
else
return 0;
end if; -- OK

caller() is the function I am looking for. Is there any function like this? If not, is there a way how to write one?

Thanks

Zoltan

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Evan Rempel 2004-06-05 06:00:04 Re: PostgreSQL certifications?
Previous Message Tom Lane 2004-06-05 04:36:02 Re: Queries slow from within plpgsql