On Fri, Jan 20, 2006 at 07:56:38AM +0100, Dick Kniep wrote:
> We are using logging in a database based on triggers and plpgsql functions.
> This works OK. However, we want deletes to be recorded too, and there we want
> the user who connected to be recorded in the log. So, how can I get the
> connected user in a triggerfunction?
Use SESSION_USER or CURRENT_USER. They're usually the same but see
the documentation for how they can differ:
http://www.postgresql.org/docs/8.1/interactive/functions-info.html
--
Michael Fuhr