Re: RFC: Logging plan of the running query - Mailing list pgsql-hackers

From Robert Haas
Subject Re: RFC: Logging plan of the running query
Date
Msg-id CA+TgmoZ-YjXougke=jej09RW2ZWJ8+hfVuBwzQvmjcD9OnObLg@mail.gmail.com
Whole thread Raw
In response to Re: RFC: Logging plan of the running query  (Julien Rouhaud <rjuju123@gmail.com>)
Responses Re: RFC: Logging plan of the running query
List pgsql-hackers
On Sun, Feb 25, 2024 at 5:00 PM Julien Rouhaud <rjuju123@gmail.com> wrote:
> Yeah, trying to find a generalized solution seems like worth investing some
> time to avoid having a bunch of CHECK_FOR_XXX() calls scattered in the code a
> few years down the road.

I just don't really see how to do it. I suspect that every task that
wants to run at some CFIs but not others is going to have slightly
different requirements, and we probably can't foresee what all of
those requirements are.

Said another way, if in the future we want to call
DoSomethingOrOther() from the CFI handler, well then we need to know
that we're not already in the middle of using any subsystem that
DoSomethingOrOther() might also try to use ... and we also need to
know that we're not in the middle of doing anything that's more
critical than DoSomethingOrOther(). But both of these are likely to
vary in each case.

EXPLAIN might be one member of a general class of things that require
catalog access (and thus might take locks or lwlocks, access the
catalogs, trigger invalidations, etc.) but it's not clear how general
that class really is. Also, I think if we try to do too many different
kinds of things at CFIs, the whole thing is going to fall apart.
You'll end up failing to foresee some interactions, or the stack will
get too deep, or ... something.

--
Robert Haas
EDB: http://www.enterprisedb.com



pgsql-hackers by date:

Previous
From: Bertrand Drouvot
Date:
Subject: Re: Injection points: some tools to wait and wake
Next
From: Peter Eisentraut
Date:
Subject: Re: backend *.c #include cleanup (IWYU)