question about executor hooks

From: Luca Ferrari <fluca1978(at)gmail(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: question about executor hooks
Date: 2025-01-14 09:08:05
Message-ID: CAKoxK+4p9rj4GDFg6hPf5QucTR7uT0_S5eBTeYJXsJ6ZOJCUQw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

In the file backend/executor/execMain.c there are the following hook types:

/* Hooks for plugins to get control in ExecutorStart/Run/Finish/End */
ExecutorStart_hook_type ExecutorStart_hook = NULL;
ExecutorRun_hook_type ExecutorRun_hook = NULL;
ExecutorFinish_hook_type ExecutorFinish_hook = NULL;
ExecutorEnd_hook_type ExecutorEnd_hook = NULL;

It is not clear to me what every hook, or better, event is associated
to. I suspect they are:
- start => prepare resources (e.g., allocate memory and stuff)
- run
- finish => execution terminated
- end => free resources

Am I wrong?

Moreover, installing an hook is cluster-wide, right? Is there a way to
limit an hook only for connections related to a single database
(without taking into account FDW and friends)?

Thanks,
Luca

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2025-01-14 09:10:35 Re: downgrade some aclchk.c errors to internal
Previous Message David Rowley 2025-01-14 09:01:57 Re: Reduce TupleHashEntryData struct size by half