Re: question about executor hooks

From: jian he <jian(dot)universality(at)gmail(dot)com>
To: Luca Ferrari <fluca1978(at)gmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: question about executor hooks
Date: 2025-01-14 13:14:16
Message-ID: CACJufxHo+Ug_qgk=i86zLCVes4ry=NSLH3iWEVudHwFP+XXemA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Jan 14, 2025 at 5:08 PM Luca Ferrari <fluca1978(at)gmail(dot)com> wrote:
>
> 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;
>

> 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
>
module contrib/pg_stat_statements/pg_stat_statements.c
using these hooks.

in a Database cluster create extension pg_stat_statements in db A, not
create pg_stat_statements in db B.
then you can do an experiment by using gdb or
add elog(INFO,,,,) at the end of pgss_ExecutorStart.
then see the effect.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Aleksander Alekseev 2025-01-14 13:25:19 Re: [PATCH] Add get_bytes() and set_bytes() functions
Previous Message Heikki Linnakangas 2025-01-14 13:13:21 Re: Recovering from detoast-related catcache invalidations