Re: Trigger to run @ connection time? - Mailing list pgsql-general

From Andrej Ricnik-Bay
Subject Re: Trigger to run @ connection time?
Date
Msg-id b35603930803111351s3bf605fer82f12246149ab57e@mail.gmail.com
Whole thread Raw
In response to Re: Trigger to run @ connection time?  ("Kynn Jones" <kynnjo@gmail.com>)
Responses Re: Trigger to run @ connection time?  ("Kynn Jones" <kynnjo@gmail.com>)
List pgsql-general
On 12/03/2008, Kynn Jones <kynnjo@gmail.com> wrote:

> If one can set up this insert operation so that it happens automatically
> whenever a new connection is made, I'd like to learn how it's done.  But if
> not, then I don't see how performing the insert "manually" every time one
> connects would be any easier than simply executing the perl_setup()
> procedure directly.
After having thought about this for a few seconds <BEG> you
could conceivably use some OS/DB integration to achieve this.
Just make sure postmaster writes new connections to a log,
monitor that log from a script, and if it sees a "connect" have
that insert a value into "special table" of yours that then can
do the trigger you looked for?   Of course I may not have quite
understood how that  "this procedure adds useful definitions,
mostly subs, to Perl's main package.  This needs to be done
for each connection" is meant to work.


Cheers,
Andrej



--
Please don't top post, and don't use HTML e-Mail :}  Make your quotes concise.

http://www.american.edu/econ/notes/htmlmail.htm

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: How to convert postgres timestamp to date: yyyy-mm-dd
Next
From: sam
Date:
Subject: Trouble with Savepoints in postgres