Re: Trigger to run @ connection time?

From: "Andrej Ricnik-Bay" <andrej(dot)groups(at)gmail(dot)com>
To: "Kynn Jones" <kynnjo(at)gmail(dot)com>
Cc: "pgsql-general General" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Trigger to run @ connection time?
Date: 2008-03-11 20:51:43
Message-ID: b35603930803111351s3bf605fer82f12246149ab57e@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 12/03/2008, Kynn Jones <kynnjo(at)gmail(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Rob Wultsch 2008-03-11 21:24:33 Re: postgre vs MySQL
Previous Message Tom Lane 2008-03-11 20:50:50 Re: How to convert postgres timestamp to date: yyyy-mm-dd