Skip site navigation (1) Skip section navigation (2)

distinguishing different database connections

From: Markus Wagner <wagner(at)imsd(dot)uni-mainz(dot)de>
To: pgsql-interfaces <pgsql-interfaces(at)postgresql(dot)org>, "pgsql-sql(at)postgresql(dot)org" <pgsql-sql(at)postgresql(dot)org>
Subject: distinguishing different database connections
Date: 2001-06-22 07:59:15
Message-ID: 3B32FAD3.47A5A9D@imsd.uni-mainz.de (view raw or flat)
Thread:
Lists: pgsql-interfacespgsql-sql
Hi,

can I access information on the current connection from within a trigger
function?
I need to identify different server connections somehow. Something like
a "connection id" would be enough.

The background:

When a user starts a frontend application (NT, Access) he starts a new
connection to our Linux database server. But for all users the "postgres
user" is the same, since the ODBC connection is hard linked into the
application. The problem is that we need the NT user name within our
trigger (C) functions.

The idea:
Let's execute a function "logon" whenever an instance of the application
is started. This function will get the NT user name as a parameter. It
will recognize the current connection id and it would store the pair
(connection id, NT user name) in a table. Then, whenever some trigger
needs to know the user name (for logging actions), it could lookup the
user name with the current connection id.

Can we do this? Please help.

Thank you very much,

Markus

Responses

pgsql-interfaces by date

Next:From: Christof GlaserDate: 2001-06-22 08:38:39
Subject: Re: [SQL] distinguishing different database connections
Previous:From: Manika DeyDate: 2001-06-21 20:32:41
Subject: OBBC for postgress

pgsql-sql by date

Next:From: Cyril SluckiDate: 2001-06-22 08:02:36
Subject: RE: Difference between insert a tuple in a table by function and by datasheet
Previous:From: DI HasenöhrlDate: 2001-06-22 07:23:17
Subject: Difference between insert a tuple in a table by function and by datasheet

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group