pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alex Pilosov <alex@acecape.com>
To: Markus Wagner <wagner@imsd.uni-mainz.de>
Cc: pgsql-interfaces <pgsql-interfaces@postgresql.org>
Cc: pgsql-sql@postgresql.org <pgsql-sql@postgresql.org>
Subject: Re: [SQL] distinguishing different database connections
Date: Fri, 22 Jun 2001 07:57:10 -0400 (EDT)
Message-ID: <Pine.BSO.4.10.10106220756200.29168-100000@spider.pilosoft.com> (raw)
In-Reply-To: <3B32FAD3.47A5A9D@imsd.uni-mainz.de>

You can use backend's PID from a trigger, it is unique.

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.
> 
> Can we do this? Please help.
> 
> Thank you very much,
> 
> Markus
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
>     (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)
> 
> 

-- 
--
Alex Pilosov            | http://www.acedsl.com/home.html
CTO - Acecape, Inc.     | AceDSL:The best ADSL in Bell Atlantic area
325 W 38 St. Suite 1005 | (Stealth Marketing Works! :)
New York, NY 10018      |




view thread (6+ messages)  latest in thread

Message-ID: <Pine.BSO.4.10.10106220756200.29168-100000@spider.pilosoft.com>
Permalink:  ../Pine.BSO.4.10.10106220756200.29168-100000@spider.pilosoft.com/
Also on:    postgresql.org/message-id/Pine.BSO.4.10.10106220756200.29168-100000@spider.pilosoft.com

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: alex@acecape.com, wagner@imsd.uni-mainz.de, pgsql-interfaces@postgresql.org
  Subject: Re: [SQL] distinguishing different database connections
  In-Reply-To: <Pine.BSO.4.10.10106220756200.29168-100000@spider.pilosoft.com>
  References: <3B32FAD3.47A5A9D@imsd.uni-mainz.de> <Pine.BSO.4.10.10106220756200.29168-100000@spider.pilosoft.com>

* 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