Re: proposal : backend startup hook / after logon trigger - Mailing list pgsql-hackers

From Robert Haas
Subject Re: proposal : backend startup hook / after logon trigger
Date
Msg-id CA+TgmoY5ANkeC_iZxXg22nc-G77iYJ1c6A=jdgBVPU9D4-cPCw@mail.gmail.com
Whole thread Raw
In response to proposal : backend startup hook / after logon trigger  (Tomas Vondra <tv@fuzzy.cz>)
Responses Re: proposal : backend startup hook / after logon trigger
List pgsql-hackers
2011/11/10 Tomas Vondra <tv@fuzzy.cz>:
> Is there any particular reason why there's not a "backend start hook",
> executed right after a backend is initialized? I've tried a very simple
> PoC (basically just a new hook definition, called from PostgresMain(),
> see the after-logon-hook.diff (and a simple module that uses it is in
> logon.c).
>
> This obviously is not a complete patch or something, but is there a good
> reason why this is a stupid idea?

[ catching up on some old email ]

I've thought of this before, but I'm not exactly clear on what the use
cases are.

The particular place where you've put this hook doesn't look right to
me.  I think it would get re-executed after each ERROR.

Also, if you're going to insist that the triggers be written in C
(blech!) then there's not much point in including a TRY/CATCH block
here.  Let the user do that themselves if they are so inclined; it's
not free.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


pgsql-hackers by date:

Previous
From: Peter Geoghegan
Date:
Subject: Re: Inlining comparators as a performance optimisation
Next
From: Robert Haas
Date:
Subject: Re: logging in high performance systems.