Re: Getting user who fired a trigger

From: Richard Huxton <dev(at)archonet(dot)com>
To: anton(at)nikiforov(dot)ru
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Getting user who fired a trigger
Date: 2004-07-07 18:43:25
Message-ID: 40EC444D.3000708@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Josh Berkus 2004-07-07 19:11:56 Re: Major PG news article
Previous Message Doseok Kim 2004-07-07 18:39:22 (no subject)