Re: [BUG v13] Crash with event trigger in extension - Mailing list pgsql-bugs

From Jehan-Guillaume de Rorthais
Subject Re: [BUG v13] Crash with event trigger in extension
Date
Msg-id 20200909125840.132229b6@firost
Whole thread Raw
In response to Re: [BUG v13] Crash with event trigger in extension  (Alvaro Herrera <alvherre@2ndquadrant.com>)
List pgsql-bugs
On Tue, 8 Sep 2020 14:32:22 -0300
Alvaro Herrera <alvherre@2ndquadrant.com> 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,



pgsql-bugs by date:

Previous
From: PG Bug reporting form
Date:
Subject: BUG #16610: server process was terminated by signal 11: Segmentation fault
Next
From: Markus Wanner
Date:
Subject: Re: invalid alloc size error possible in shm_mq