From: | Duane Lee - EGOVX <DLee(at)mail(dot)maricopa(dot)gov> |
---|---|
To: | "'BARTKO Zoltan'" <bartko(dot)zoltan(at)pobox(dot)sk>, pgsql-general(at)postgresql(dot)org |
Subject: | Re: How to find out who is calling the function |
Date: | 2004-06-07 16:11:07 |
Message-ID: | 64EDC403A1417B4299488BAE87CA7CBF01CD0E5B@maricopa_xcng0 |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Why not use CURRENT_USER?
-----Original Message-----
From: BARTKO Zoltan [mailto:bartko(dot)zoltan(at)pobox(dot)sk]
Sent: Friday, June 04, 2004 10:34 PM
To: pgsql-general(at)postgresql(dot)org
Subject: [GENERAL] How to find out who is calling the function
Dear friends,
I had a look at www.pgsql.ru <http://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
From | Date | Subject | |
---|---|---|---|
Next Message | Prabu Subroto | 2004-06-07 16:38:33 | postgres on SuSE 9.1 |
Previous Message | Jack Kerkhof | 2004-06-07 15:52:55 | Identifying the 'current user' when using a connection pool |