On Mon, Jan 18, 2021 at 11:56 AM Tom Lane <tgl@sss.pgh.pa.us> wrote:
> > I've wanted this in the past, too, so +1 from me.
>
> I dunno, this seems pretty scary and easily abusable. There's not all
> that much that can be done safely in ProcessInterrupts(), and we should
> not be encouraging extensions to think they can add random processing
> there.
We've had this disagreement before about other things, and I just
don't agree. If somebody uses a hook for something wildly unsafe, that
will break their stuff, not ours. That's not to say I endorse adding
hooks for random purposes in random places. In particular, if it's
impossible to use a particular hook in a reasonably safe way, that's a
sign that the hook is badly-designed and that we should not have it.
But, that's not the case here. I care more about smart extension
authors being able to do useful things than I do about the possibility
that dumb extension authors will do stupid things. We can't really
prevent the latter anyway: this is open source.
> We're about halfway there already, see 7e784d1dc. I didn't do the
> other half because it wasn't necessary to the problem, but exposing
> the shutdown state more fully seems reasonable.
Ah, I hadn't realized.
--
Robert Haas
EDB: http://www.enterprisedb.com