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

From Anton Nikiforov
Subject Getting user who fired a trigger
Date
Msg-id 40EC2775.20206@nikiforov.ru
Whole thread Raw
Responses Re: Getting user who fired a trigger  (Richard Huxton <dev@archonet.com>)
List pgsql-general
Dear All,
I have made a trigger procedure that logs all table's changes to the
log_table in XML format, but i do need to log a user who did that and
not succsessful with this.
The documentation (including "37.10. Trigger Procedures") give me nothing.
Could somene supply me with a solution or documentation part that i
should read?
My trigger function is written in PL/Ruby because i found no way to make
a "table's structure independent function" with PL/pgsql.

And one more question - is there any special type to store XML instead
of text? This question arised from the problem, that i'm planning (and i
do need this) to store all the database updation history and some small
procedures like adding a user will produce from 1 to 10 records in the
log table of text type. So updating of 1 byte will produce kilobytes of
text. So, maybe there is some compact type for XML storing? (i know that
i could pack it and store in zipped or other format, but i would like to
have a search possibility);

--
Best regads,
Anton Nikiforov


Attachment

pgsql-general by date:

Previous
From: Franco Bruno Borghesi
Date:
Subject: Re: Error in postgreSQL
Next
From: Bruno Wolff III
Date:
Subject: Re: Grant Select privileges for all tables in schema