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

From Kynn Jones
Subject Re: Trigger to run @ connection time?
Date
Msg-id c2350ba40803111135y5b648c4eta2896bf798d818b8@mail.gmail.com
Whole thread Raw
In response to Re: Trigger to run @ connection time?  (Alban Hertroys <dalroi@solfertje.student.utwente.nl>)
Responses Re: Trigger to run @ connection time?  ("Andrej Ricnik-Bay" <andrej.groups@gmail.com>)
Re: Trigger to run @ connection time?  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general


On Mon, Mar 10, 2008 at 7:47 PM, Alban Hertroys <dalroi@solfertje.student.utwente.nl> wrote:

You can't define triggers on system tables.
 
Oh, well... :-/  Thanks for the reality check!

> If not, is there some other way to set up a trigger that

Oops.  I guess a cut-and-paste error in my original message must have caused some text to be lost.  I meant to write

> If not, is there some other way to set up a trigger that will run whenever a new connection to my_db is 
> established?

One could be forgiven for not being able to figure out what I was asking, but, if, in spite of the huge typo, you were in fact able to guess what I had meant to ask, then I'm confused by your suggestion here:
 
Closest thing I can think of is defining a table that you insert a
record in as soon as you connect and put a trigger on that.

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.

Kynn

pgsql-general by date:

Previous
From: rrahul
Date:
Subject: postgre vs MySQL
Next
From: "A. Kretschmer"
Date:
Subject: Re: How to convert postgres timestamp to date: yyyy-mm-dd