Re: [SQL] distinguishing different database connections

From: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
To: Markus Wagner <wagner(at)imsd(dot)uni-mainz(dot)de>
Cc: pgsql-interfaces <pgsql-interfaces(at)postgresql(dot)org>, "pgsql-sql(at)postgresql(dot)org" <pgsql-sql(at)postgresql(dot)org>
Subject: Re: [SQL] distinguishing different database connections
Date: 2001-06-22 18:40:16
Message-ID: Pine.BSF.4.21.0106221138530.9504-100000@megazone23.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-interfaces pgsql-sql


How about creating a temporary table with the data? That'll be persistant
for the session.

On Fri, 22 Jun 2001, Markus Wagner wrote:

> 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.

In response to

Browse pgsql-interfaces by date

  From Date Subject
Next Message Ana Carolina Alonso de Armiño 2001-06-22 19:36:06 JDBC interface
Previous Message Ana Carolina Alonso de Armiño 2001-06-22 15:01:47 postgres 7.1.2 with SuSE 7.1

Browse pgsql-sql by date

  From Date Subject
Next Message Alex Pilosov 2001-06-22 18:46:00 Re: timestamp conversion to unisgned long?
Previous Message Josh Berkus 2001-06-22 18:37:44 Re: View performance question