Unique ID for current connection from C

From: Shawn Garbett <shawn_garbett(at)yahoo(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: Unique ID for current connection from C
Date: 2005-07-19 19:41:27
Message-ID: 20050719194127.60217.qmail@web54403.mail.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

I'm still trying to figure out how to save a variable
attached to a connection. The basic problem is that a
front end app server has a connection pool, all with
the same user/password login. I want to communicate
the authenticated user to auditing triggers firing in
a postgres backend. I can add a query into the
beginning of a transaction by using an intercepter
from the persistence layer. The goal is that the query
will then place the authenticated user info somewhere
that a Postgres trigger can use it.

I am exploring writing an extension in C to Postgres,
but I can't find how to get a unique number
identifying the current connection. Then I can use a
global hash (with updates protected by a semaphore).
Is there a way to get an ID for the current connection
from C? If so I know how to do the rest.

Shawn

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Tom Lane 2005-07-19 19:55:17 Re: Hosting
Previous Message operationsengineer1 2005-07-19 19:39:56 Re: Hosting