Re: audit information - Mailing list pgsql-novice

From Michael Fuhr
Subject Re: audit information
Date
Msg-id 20050425153534.GA2107@winnie.fuhr.org
Whole thread Raw
In response to audit information  ("Keith Worthington" <keithw@narrowpathinc.com>)
Responses Re: audit information  ("Keith Worthington" <keithw@narrowpathinc.com>)
Re: audit information  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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 by date:

Previous
From: "Keith Worthington"
Date:
Subject: audit information
Next
From: "Keith Worthington"
Date:
Subject: Re: audit information