Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pj3hF-0003Tm-35 for pgsql-hackers@arkaria.postgresql.org; Sun, 02 Apr 2023 19:49:01 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pj3hC-0007DU-9y for pgsql-hackers@arkaria.postgresql.org; Sun, 02 Apr 2023 19:48:58 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pj3hB-0007DF-U6 for pgsql-hackers@lists.postgresql.org; Sun, 02 Apr 2023 19:48:58 +0000 Received: from mail-il1-x12b.google.com ([2607:f8b0:4864:20::12b]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1pj3h8-0002ux-TC for pgsql-hackers@lists.postgresql.org; Sun, 02 Apr 2023 19:48:56 +0000 Received: by mail-il1-x12b.google.com with SMTP id n1so13625899ili.10 for ; Sun, 02 Apr 2023 12:48:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telsasoft-com.20210112.gappssmtp.com; s=20210112; t=1680464934; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=soARyRuQ4dhbfiP7CvjhHg6d6TGap6RX4SSV+hkLNMY=; b=OSKjBYnq1bU8cypZpswDy5iOEAuig+YJ5ZwnZ3vaKa3GDAcc2HUcxkooY4iav1D8OY aw2kcP/QRQHxpuPPGkWZx5HE/EFfW9/UQ7V9meBSiv69dB47rOkT4z83uiR2v8sAMENW zH4QrEqLPGPPKJ0IJzxDqgosnXc7Aqmi4voxCaJU9Rz5ma4H7a4xL00Vd7jmDQ5fj/JX fCHm18fLgCRYW44fcjWA+Qq29s6P/m0gJGbkJ6OSCH/pw4DsHnonuOEaMXUamb4eZ7Yt /jIjajldrLJqB3Ncg+xyhmXwdCVoy8pIslGZP6yCaXQsh0n+YE2Ll4rJh6UdbkWNG/CX i8dw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680464934; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=soARyRuQ4dhbfiP7CvjhHg6d6TGap6RX4SSV+hkLNMY=; b=CU7pUatbLRJzumZ+0BUzwBU9J1t/AmxU74le1+myY2ZjK9i/g7SbpuCnvcHyQ3pMR9 TnHbrrxunypHiwTxcbqQOYSr+1raG98AkYo+vt8x+L5Z4chVT/1d0wADbNOL1ylfxaP8 UPBHHhFRR48Fr4xPlCg919reEWboeehL+zLXgpnibAxuH8MRIcS3mMtNkiYVaiRJE+pd PSNvuluE8iXfP165C+E+m1uHXenZntoC+WJvmoEJ1Zx6GWrkj2NteVlgsielfAHNCFLn uGBM2FiRDnylF6a9tKyU6BajyZBtDveIPVC4nRR8DvRZsqxmcx2EZL79WKsRfoi+AlgX KZYQ== X-Gm-Message-State: AAQBX9dOfAAV4ZfGBWRnpBqyZ3AFDzekxtl93YPbxWH04hSWjjVcvuKN PnaONqHk+YmhQjc9e7OcctUBvg== X-Google-Smtp-Source: AKy350bXqDNAPS5ULU14SZL9jhZTCNprL1I5JyKNfQtTJUrfy/JvFx2CoulCuyhXExWarrAdwQhGvw== X-Received: by 2002:a05:6e02:146:b0:318:a974:ab4a with SMTP id j6-20020a056e02014600b00318a974ab4amr18689295ilr.6.1680464934281; Sun, 02 Apr 2023 12:48:54 -0700 (PDT) Received: from pryzbyj.telsasoft (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id p69-20020a022948000000b0040306bfd949sm2213028jap.21.2023.04.02.12.48.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 02 Apr 2023 12:48:53 -0700 (PDT) Received: by pryzbyj.telsasoft (Postfix, from userid 1000) id D0DDF801AA5; Sun, 2 Apr 2023 14:48:52 -0500 (CDT) Date: Sun, 2 Apr 2023 14:48:52 -0500 From: Justin Pryzby To: Daniel Gustafsson Cc: Mikhail Gribkov , pgsql-hackers@lists.postgresql.org Subject: Re: GUC for temporarily disabling event triggers Message-ID: References: <9140106E-F9BF-4D85-8FC8-F2D3C094A6D9@yesql.se> <167482801126.1114.1095311628314619931.pgcf@coridan.postgresql.org> <8D26ACC2-7669-460D-833A-582EAD6CC09E@yesql.se> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8D26ACC2-7669-460D-833A-582EAD6CC09E@yesql.se> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Mon, Mar 06, 2023 at 01:24:56PM +0100, Daniel Gustafsson wrote: > > On 27 Jan 2023, at 15:00, Mikhail Gribkov 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: + ddl_command_start, ddl_command_end, + table_rewrite and sql_drop. + Additionally, all event triggers can be disabled by setting it to + all. Setting the value to none + 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