Re: Getting user who fired a trigger - Mailing list pgsql-general

From Richard Huxton
Subject Re: Getting user who fired a trigger
Date
Msg-id 40EC444D.3000708@archonet.com
Whole thread Raw
In response to Re: Getting user who fired a trigger  (Anton Nikiforov <anton@nikiforov.ru>)
List pgsql-general
Anton Nikiforov wrote:
>>> Could somene supply me with a solution or documentation part that i
>>> should read?
>>
>>
>>
>> Can't remember which part it is, but you want one of:
>>   SELECT CURRENT_USER;
>>   SELECT SESSION_USER;
>
> test=# SELECT CURRENT_USER;
>  current_user
> --------------
>  anton
> (1 row)
>
> test=# SELECT SESSION_USER;
>  session_user
> --------------
>  anton
> (1 row)
>
> This gives the same output. Looks like i should check this with the real
> operatins to understand the difference or RT*M more.

Sometimes a function may be running with the permissions of its creator
rather than the user running it. See the CREATE FUNCTION reference for
details.

--
   Richard Huxton
   Archonet Ltd

pgsql-general by date:

Previous
From: Doseok Kim
Date:
Subject: (no subject)
Next
From: "Andy B"
Date:
Subject: Re: postgresql +AMD64 +big address spaces - does it work?