User Context Variables - Mailing list pgsql-novice

From Shawn Garbett
Subject User Context Variables
Date
Msg-id 20050715214613.62708.qmail@web54410.mail.yahoo.com
Whole thread Raw
Responses Re: User Context Variables
List pgsql-novice
I need to trap some audit information in PostgreSQL.
Currently we have it working Oracle and it stores the
authenticated user in the sys_context so that a
trigger just does a "select userenv('client_info')
from dual;" and all the necessary magic is handled.
The reasons for this are complex, it involves
connection pooling, detached web sessions, etc. It's a
very elegant solution when using Oracle.

I'm having trouble figuring out how to do it in
PostgreSQL. So what I need is a way to save a single
value in a connection for a set of triggers to use
that is only valid during a transaction. A place to
store a user variable like sys context would work, a
temporary table would work, or some mysterious
function that did the equivalent would work. I can't
figure out if these are possible under PostgreSQL.

Shawn

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

pgsql-novice by date:

Previous
From: Bruno Wolff III
Date:
Subject: Re: Backups
Next
From: Jaime Casanova
Date:
Subject: Re: plpgsql trigger problem