Re: proposal : backend startup hook / after logon trigger

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Tomas Vondra <tv(at)fuzzy(dot)cz>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: proposal : backend startup hook / after logon trigger
Date: 2011-11-25 01:44:19
Message-ID: CA+TgmoY5ANkeC_iZxXg22nc-G77iYJ1c6A=jdgBVPU9D4-cPCw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

2011/11/10 Tomas Vondra <tv(at)fuzzy(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2011-11-25 01:56:07 Re: logging in high performance systems.
Previous Message Peter Geoghegan 2011-11-25 01:05:15 Re: Inlining comparators as a performance optimisation