Re: GUC for temporarily disabling event triggers

From: Justin Pryzby <pryzby(at)telsasoft(dot)com>
To: Daniel Gustafsson <daniel(at)yesql(dot)se>
Cc: Mikhail Gribkov <youzhick(at)gmail(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: GUC for temporarily disabling event triggers
Date: 2023-04-02 19:48:52
Message-ID: ZCncJGbFLex2f9GP@telsasoft.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Mar 06, 2023 at 01:24:56PM +0100, Daniel Gustafsson wrote:
> > On 27 Jan 2023, at 15:00, Mikhail Gribkov <youzhick(at)gmail(dot)com> wrote:
>
> > There is a complete framework for disabling various types of the event triggers separately, but, the list of valid GUC values only include 'all' and 'none'. Why not adding support for all the event trigger types separately? Everything is already there in the patch; the only thing needed is expanding couple of enums. It's cheap in terms of code size and even cheaper in terms of performance. And moreover - it would be a good example for anyone adding new trigger types.
>
> I can't exactly recall my reasoning, but I do think you're right that if we're
> to have this GUC it should support the types of existing EVTs. The updated v4
> implements that as well as a rebase on top of master and fixing a typo
> discovered upthread.
>
+ gettext_noop("Disable event triggers for the duration of the session."),

Why does is it say "for the duration of the session" ?

It's possible to disable ignoring, and within the same session.
GUCs are typically "for the duration of the session" .. but they don't
say so (and don't need to).

+ elog(ERROR, "unsupport event trigger: %d", event);

typo: unsupported

+ Allows to temporarily disable event triggers from executing in order

=> Allow temporarily disabling execution of event triggers ..

+ to troubleshoot and repair faulty event triggers. The value matches
+ the type of event trigger to be ignored:
+ <literal>ddl_command_start</literal>, <literal>ddl_command_end</literal>,
+ <literal>table_rewrite</literal> and <literal>sql_drop</literal>.
+ Additionally, all event triggers can be disabled by setting it to
+ <literal>all</literal>. Setting the value to <literal>none</literal>
+ will ensure that all event triggers are enabled, this is the default

It doesn't technically "ensure that they're enabled", since they can be
disabled by ALTER. Better to say that it "doesn't disable any even triggers".

--
Justin

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Nathan Bossart 2023-04-02 19:50:05 Re: O(n) tasks cause lengthy startups and checkpoints
Previous Message Nathan Bossart 2023-04-02 19:30:30 Re: O(n) tasks cause lengthy startups and checkpoints