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 1kFxoy-0000KA-Hp for pgsql-bugs@arkaria.postgresql.org; Wed, 09 Sep 2020 10:59:24 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kFxoR-0007tj-Is for pgsql-bugs@arkaria.postgresql.org; Wed, 09 Sep 2020 10:58:51 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kFxoR-0007t5-4S for pgsql-bugs@lists.postgresql.org; Wed, 09 Sep 2020 10:58:51 +0000 Received: from mail.dalibo.com ([212.85.157.172]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kFxoK-000622-ML for pgsql-bugs@lists.postgresql.org; Wed, 09 Sep 2020 10:58:50 +0000 Received: from firost (larco.ioguix.net [82.66.0.6]) by mail.dalibo.com (Postfix) with ESMTPSA id A4ECD20229; Wed, 9 Sep 2020 12:58:41 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=dalibo.com; s=a; t=1599649121; bh=AqyH6B3scm/Tc/TK1ozJgPV9QgAAex0N7AqjCaNI5Fg=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=rE6YgypjQH0vMGUtqM52ZoPTUi84Lml5nAyyd5XVpJQqi3saCIrIlQGBLEljeTfJU Sx6LV+bv+hRjdXL1ZFT9HKojIeTJFFJoREYCf6l3HNeO8HvZUkCirhbCSKvsew9bfo DbxUQ5q6Z4U5y2g6qXEtxjb+FJBwsnfYGwHlwpaw= Date: Wed, 9 Sep 2020 12:58:40 +0200 From: Jehan-Guillaume de Rorthais To: Alvaro Herrera Cc: Michael Paquier , pgsql-bugs@lists.postgresql.org Subject: Re: [BUG v13] Crash with event trigger in extension Message-ID: <20200909125840.132229b6@firost> In-Reply-To: <20200908173222.GA781@alvherre.pgsql> References: <20200908190759.12405fe5@firost> <20200908173222.GA781@alvherre.pgsql> Organization: Dalibo MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Tue, 8 Sep 2020 14:32:22 -0300 Alvaro Herrera wrote: > On 2020-Sep-08, Jehan-Guillaume de Rorthais wrote: > > > I still have a last question in mind though. While running the bellow > > scenario, the DDL in the extension do not trigger evt_ext_ddl_fnct. Is it > > normal/expected? > > Hmm, I think this is intentional; see standard_ProcessUtility and > ProcessUtilitySlow, noting the value of isCompleteQuery for the > execution of the extension script. According to extension.c:execute_sql_string(), queries from extension script are executed as PROCESS_UTILITY_QUERY context. So isCompleteQuery is indeed always true in ProcessUtilitySlow. A breakpoint here while running my test case confirm this. Maybe you were talking about isTopLevel? But this one doesn't seem considered while defining if event triggers should trigger or not. Anyway, if event trigger should not trigger during create/alter extension, I suppose the original memory context bug that starts this discussion shouldn't happen in the first place (but need to be fixed anyway), isn't it? Regards,