From: imad <immaad@gmail.com>
To: Rajesh Kumar Mallah <mallah.rajesh@gmail.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: transactional shared variable in postgresql
Date: Sat, 18 Nov 2006 18:46:02 +0500
Message-ID: <1f30b80c0611180546p35332e82mb592bcd6a048576d@mail.gmail.com> (raw)
In-Reply-To: <a97c77030611180430p764dac32ue19ade554ec80cbe@mail.gmail.com>
References: <a97c77030611180430p764dac32ue19ade554ec80cbe@mail.gmail.com>
Why dont you try to make 'username' part of your query.
While auditing updates and inserts, the username can be some how made
a part of the tuple being inserted. Just a thought!
--Imad
www.EnterpriseDB.com
On 11/18/06, Rajesh Kumar Mallah <mallah.rajesh@gmail.com> wrote:
> Hi ,
>
> Is there any way to set a variable from a web application (using dbi/perl ,
> libpq etc),
> and access the same variable from a C trigger inside a transaction ?
>
> the %_SHARED hash available in plperl provides only session level isolation
> and
> does not suit the requirement.
>
>
> Original problem:
>
> we want to setup table auditing using table_log or audittrail projects.
> the triggers used in these systems uses the current database user
> to log to the audit tables..
>
> In our webapps, we use the same username to connect to the database
> for all kind of updates. Hence we are not able to makeout whoo modified
> what . However at application level we have different "userid" for different
> users of the system. we want to somehow pass this "userid" to the databasee
> server and accesss it from the triggers that implement the audit functions.
>
> we thought of using a table of single row and single column to store
> the userid but we are concerned over the performance due to locking
> issues.
>
> Regds
> Mallah.
>
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: immaad@gmail.com, mallah.rajesh@gmail.com
Subject: Re: transactional shared variable in postgresql
In-Reply-To: <1f30b80c0611180546p35332e82mb592bcd6a048576d@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox