Re: Trigger to run @ connection time?

From: "Kynn Jones" <kynnjo(at)gmail(dot)com>
To: "Alban Hertroys" <dalroi(at)solfertje(dot)student(dot)utwente(dot)nl>
Cc: "pgsql-general General" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Trigger to run @ connection time?
Date: 2008-03-11 18:35:56
Message-ID: c2350ba40803111135y5b648c4eta2896bf798d818b8@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, Mar 10, 2008 at 7:47 PM, Alban Hertroys <
dalroi(at)solfertje(dot)student(dot)utwente(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Mike 2008-03-11 18:45:39 Re: message contents do not agree with length in message type "T"
Previous Message A. Kretschmer 2008-03-11 18:26:06 Re: basic plpgsql / sql funtion question