Identifying the 'current user' when using a connection pool - Mailing list pgsql-general

From Jack Kerkhof
Subject Identifying the 'current user' when using a connection pool
Date
Msg-id ENEIKKAEJOFHOIHMMOIDMEMGIAAA.jack.kerkhof@guest-tek.com
Whole thread Raw
List 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.kerkhof@guest-tek.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.
 

pgsql-general by date:

Previous
From: Jeff Boes
Date:
Subject: Re: Timestamp precision and rounding
Next
From: "Alexander S."
Date:
Subject: bug in 7.4.2, concern unicode and russian content of db