Re: Implicitly created operator family not listed by pg_event_trigger_ddl_commands

From: Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>
To: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
Cc: LEMAIRE Leslie (Chargée de mission) - SG/SNUM/UNI/DRC <leslie(dot)lemaire(at)developpement-durable(dot)gouv(dot)fr>, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: Implicitly created operator family not listed by pg_event_trigger_ddl_commands
Date: 2022-05-06 05:26:42
Message-ID: CAD21AoBGqNBe=ydCxSoZnZQw9RA72DbQnTuFOhVDWkvF1wvHXw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Wed, May 4, 2022 at 7:17 PM Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org> wrote:
>
> On 2022-May-02, LEMAIRE Leslie (Chargée de mission) - SG/SNUM/UNI/DRC wrote:
>
> > As stated in the documentation [1], creating an operator class without
> > specifying the FAMILY option will create an operator family with the same
> > name as the new class if it doesn't already exist. In this case, my event
> > trigger is activated through the "CREATE OPERATOR CLASS" tag as usual, but
> > pg_event_trigger_ddl_commands() still returns only one row - for the
> > operator class creation. I would have expected it to list the creation of
> > the operator family as well.
>
> I agree, this looks like an omission somewhere -- the extra object
> should have been reported.

Agreed.

DefineOpClass() calls CreateOpFamily() to create the operator family
but in CreateOpFamily() we don't report the new object to event
triggers. The event by CREATE OPERATOR FAMILY is normally reported by
ProcessUtilitySlow(). I've confirmed this happens on all supported
branches. I've attached a patch to fix it.

Regards,

--
Masahiko Sawada
EDB: https://www.enterprisedb.com/

Attachment Content-Type Size
report_create_opfamily_event_on_opclass_creation.patch application/octet-stream 4.8 KB

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Jobin Augustine 2022-05-06 05:37:28 Re: Security Definer functions no longer works in PG14+
Previous Message Jan Katins 2022-05-05 18:31:58 Re: Security Definer functions no longer works in PG14+