Re: audit information

Поиск
Список
Период
Сортировка
От Michael Fuhr
Тема Re: audit information
Дата
Msg-id 20050425153534.GA2107@winnie.fuhr.org
обсуждение исходный текст
Ответ на audit information  ("Keith Worthington" <keithw@narrowpathinc.com>)
Ответы Re: audit information  ("Keith Worthington" <keithw@narrowpathinc.com>)
Re: audit information  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-novice
On Mon, Apr 25, 2005 at 10:41:09AM -0400, Keith Worthington wrote:
>
> Is there a way to obtain the postgres user id or must I store the output of
> session_user in the tables?

You could grab usesysid from pg_user:

SELECT usesysid FROM pg_user WHERE usename = session_user;

You can convert the user ID back to the name with pg_get_userbyid():

SELECT pg_get_userbyid(1);

--
Michael Fuhr
http://www.fuhr.org/~mfuhr/

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

Предыдущее
От: "Keith Worthington"
Дата:
Сообщение: audit information
Следующее
От: "Keith Worthington"
Дата:
Сообщение: Re: audit information