Re: How to get the session user in a C user defined function

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Re: How to get the session user in a C user defined function
Дата
Msg-id CAB7nPqQdMGbY+WEWp684gpz9pz8YzhBmSoL-+hA=ys4OZwKRmw@mail.gmail.com
обсуждение исходный текст
Ответ на How to get the session user in a C user defined function  (John Leiseboer <jleiseboer@bigpond.com>)
Список pgsql-general
On Thu, Oct 15, 2015 at 2:38 PM, John Leiseboer <jleiseboer@bigpond.com> wrote:
> I would like to get the session_user into a C char[] in a C language UDF. I have found what appears to be a function
returninga Datum type called session_user, but I'm having trouble working out how to call it from within my C function.
Cananyone provide some advice on how to do this? 

What you are looking for is in miscadmin.h:
username = GetUserNameFromId(GetSessionUserId());
Regards,
--
Michael


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

Предыдущее
От: John Leiseboer
Дата:
Сообщение: How to get the session user in a C user defined function
Следующее
От: Lele Gaifax
Дата:
Сообщение: Re: Understanding "seq scans"