Identifying the 'current user' when using a connection pool

From: "Jack Kerkhof" <jack(dot)kerkhof(at)guest-tek(dot)com>
To: <pgsql-general(at)postgresql(dot)org>
Subject: Identifying the 'current user' when using a connection pool
Date: 2004-06-07 15:52:55
Message-ID: ENEIKKAEJOFHOIHMMOIDMEMGIAAA.jack.kerkhof@guest-tek.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

We have a database that sets a column called MOD_BY = CURRENT_USER to almost
all tables on INSERT and UPDATE.

But now that the application is n-tier, and uses connection pools, the
current_user no longer reflects the 'application user'.

Is there any way to temporarily alter 'current_user' with an alias for the
duration of a transaction? IE

...<set current_user = 'application user alias'>...

Any other suggestions on how to transition end-user identity in a connection
pool environment?

Thanks, Jack

Jack Kerkhof
Research & Development
jack(dot)kerkhof(at)guest-tek(dot)com
www.guest-tek.com
1.866.509.1010 3480

--------------------------------------------------------------------------

Guest-Tek (TSX:GTK) is a global provider of technology solutions to
the hospitality industry. Endorsed by more major hotel chains than any of
its competitors, Guest-Tek has installed its solutions in more than 570
hotels worldwide.

Browse pgsql-general by date

  From Date Subject
Next Message Duane Lee - EGOVX 2004-06-07 16:11:07 Re: How to find out who is calling the function
Previous Message Tom Lane 2004-06-07 15:50:40 Re: [HACKERS] CREATE DATABASE on the heap with PostgreSQL?