Re: Looking for context around which event triggers are permitted - Mailing list pgsql-hackers

From Isaac Morland
Subject Re: Looking for context around which event triggers are permitted
Date
Msg-id CAMsGm5cTH0zfNgXw-ABTYKnGs2K907AFfbX0L8iPM8fedLQrQg@mail.gmail.com
Whole thread Raw
In response to Re: Looking for context around which event triggers are permitted  (Aleksander Alekseev <aleksander@timescale.com>)
Responses Re: Looking for context around which event triggers are permitted
List pgsql-hackers
On Mon, 17 Jul 2023 at 11:26, Aleksander Alekseev <aleksander@timescale.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.

pgsql-hackers by date:

Previous
From: Aleksander Alekseev
Date:
Subject: Re: Looking for context around which event triggers are permitted
Next
From: Melih Mutlu
Date:
Subject: Re: [PATCH] Reuse Workers and Replication Slots during Logical Replication