Re: Looking for context around which event triggers are permitted

From: Isaac Morland <isaac(dot)morland(at)gmail(dot)com>
To: Aleksander Alekseev <aleksander(at)timescale(dot)com>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org, Garrett Thornburg <film42(at)gmail(dot)com>
Subject: Re: Looking for context around which event triggers are permitted
Date: 2023-07-17 15:39:52
Message-ID: CAMsGm5cTH0zfNgXw-ABTYKnGs2K907AFfbX0L8iPM8fedLQrQg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, 17 Jul 2023 at 11:26, Aleksander Alekseev <aleksander(at)timescale(dot)com>
wrote:

> Hi,
>
> > I was working on a project with event triggers and was wondering if
> there was any context from the developers around why some things make this
> list and others do not. Example: REVOKE/ GRANT are in the event trigger
> matrix [1] but REINDEX is not. Just wondering if there's a mailing list
> thread or a commit message that has more info. I can't seem to find
> anything in the postgres list archives. Thanks!
> >
> > [1] https://www.postgresql.org/docs/15/event-trigger-matrix.html
>
> Good question. My guess would be that no one really needed an event
> trigger for REINDEX so far.
>

My answer is not authoritative, but I notice that ANALYZE and VACUUM are
also not there. Those, together with REINDEX, are maintenance commands,
which normally should not affect which queries you can run or their
results. If we think of the queries we can run and the objects we can run
them against as forming an abstraction with maintenance commands breaking
the abstraction, then we can think of event triggers as operating against
the abstraction layer, not the underlying maintenance layer.

On the other hand, the event triggers include tags related to indexes,
which themselves (except for enforcement of uniqueness) in some sense sit
below the abstraction: presence of an index can affect the query plan and
how efficient it is, but shouldn't change the result of a query or whether
it is a valid query. So this is not a fully satisfactory explanation.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Melih Mutlu 2023-07-17 15:54:30 Re: [PATCH] Reuse Workers and Replication Slots during Logical Replication
Previous Message Aleksander Alekseev 2023-07-17 15:26:32 Re: Looking for context around which event triggers are permitted