pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Christof Glaser <gcg@gl.aser.de>
To: Markus Wagner <wagner@imsd.uni-mainz.de>
To: pgsql-interfaces <pgsql-interfaces@postgresql.org>
To: pgsql-sql@postgresql.org <pgsql-sql@postgresql.org>
Subject: Re: [SQL] distinguishing different database connections
Date: Fri, 22 Jun 2001 10:38:39 +0200
Message-ID: <01062210383901.00729@pinguin> (raw)
In-Reply-To: <3B32FAD3.47A5A9D@imsd.uni-mainz.de>
References: <3B32FAD3.47A5A9D@imsd.uni-mainz.de>

Hi Markus,

On Friday, 22. June 2001 09:59, 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.

I think, there is no such thing like a connection id.

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

What about looking how web applications handle this? A "session id", 
which you have to manage yourself, might do what you want:

<just_an_idea>
- logon creates a session id
- actions that need to keep track of users should be done within 
functions called by the client, providing the session id as a parameter.
</idea>

HTH.
Christof



view thread (6+ messages)  latest in thread

Message-ID: <01062210383901.00729@pinguin>
Permalink:  ../01062210383901.00729@pinguin/
Also on:    postgresql.org/message-id/01062210383901.00729@pinguin

 · 

reply

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-interfaces@postgresql.org
  Cc: gcg@gl.aser.de, wagner@imsd.uni-mainz.de, pgsql-sql@postgresql.org
  Subject: Re: [SQL] distinguishing different database connections
  In-Reply-To: <01062210383901.00729@pinguin>

* 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