Re: audit information

From: Michael Fuhr <mike(at)fuhr(dot)org>
To: Keith Worthington <keithw(at)narrowpathinc(dot)com>
Cc: PostgreSQL Novice <pgsql-novice(at)postgresql(dot)org>
Subject: Re: audit information
Date: 2005-04-25 15:35:34
Message-ID: 20050425153534.GA2107@winnie.fuhr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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/

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Keith Worthington 2005-04-25 15:44:32 Re: audit information
Previous Message Keith Worthington 2005-04-25 14:41:09 audit information