Re: New feature proposal (trigger)

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
Cc: Sergiu Velescu <Sergiu(dot)Velescu(at)endava(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: New feature proposal (trigger)
Date: 2020-01-23 19:01:15
Message-ID: 14468.1579806075@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com> writes:
> čt 23. 1. 2020 v 17:26 odesílatel Sergiu Velescu <Sergiu(dot)Velescu(at)endava(dot)com>
> napsal:
>> I would like to propose a new feature which is missing in PgSQL but quite
>> useful and nice to have (and exists in Oracle and probably in some other
>> RDBMS), I speak about “Database Level” triggers: BeforePgStart,
>> AfterPgStarted, OnLogin, OnSuccessfulLogin, BeforePGshutdown, OnLogOut – I
>> just mentioned some of it but the final events could be different.

> Do you have some examples of these useful triggers?
> I don't know any one.

See also the fate of commit e788bd924, which proposed to add
on-session-start and on-session-end hooks. Getting that sort of thing
to work safely is a LOT harder than it sounds. There are all sorts of
definitional and implementation problems, at least if you'd like the
hook or trigger to do anything interesting (like run a transaction).

I rather suspect that exposing such a thing at SQL level would also add
a pile of security considerations (i.e. who's allowed to do what to whom).
The hook proposal didn't have to address that, but a trigger feature
certainly would.

Maybe it's all do-able, but the work to benefit ratio doesn't look
very appetizing to me.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2020-01-23 19:04:14 Re: making the backend's json parser work in frontend code
Previous Message Robert Haas 2020-01-23 19:00:23 Re: making the backend's json parser work in frontend code