How to find out who is calling the function

Поиск
Список
Период
Сортировка
От BARTKO Zoltan
Тема How to find out who is calling the function
Дата
Msg-id 008001c44abe$c0df0720$0e5d10ac@antik.org
обсуждение исходный текст
Ответы Re: How to find out who is calling the function
Список 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

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Queries slow from within plpgsql
Следующее
От: Greg Stark
Дата:
Сообщение: Re: Timestamp precision and rounding