Re: Implicitly created operator family not listed by pg_event_trigger_ddl_commands

From: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>, Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, LEMAIRE Leslie (Chargée de mission) - SG/SNUM/UNI/DRC <leslie(dot)lemaire(at)developpement-durable(dot)gouv(dot)fr>, PostgreSQL mailing lists <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-20 08:51:22
Message-ID: CAA4eK1L5cRxRLoKHxSUfZMUP0JgfNNovFkp935k=DEh9wTdPWA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Thu, May 19, 2022 at 2:26 PM Michael Paquier <michael(at)paquier(dot)xyz> wrote:
>
> On Fri, May 06, 2022 at 02:26:42PM +0900, Masahiko Sawada wrote:
> > 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.
>
> Hmm. It looks like it makes sense to back-patch that.
>

Yeah, I also don't see a reason to not backpatch this.

> That's indeed
> a bit surprising to not have an event trigger inform about both.
>
> +-- CRAETE OPERATOR CLASS without FAMILY clause should report
> +-- both CRAETE OPERATOR FAMILY and CRAETE OPERATOR CLASS
> Got the same typo here, repeated three times.
>
> - tmpAddr = CreateOpFamily(stmt->amname, opcname,
> + tmpAddr = CreateOpFamily(&opfstmt, stmt->amname, opcname,
> namespaceoid, amoid);
> CreateOpFamily() does not need its second argument now that you pass
> down a CreateOpFamilyStmt as first argument, no?
>

Right, apart from the patch looks good to me.

--
With Regards,
Amit Kapila.

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Alvaro Herrera 2022-05-20 10:34:32 Re: Implicitly created operator family not listed by pg_event_trigger_ddl_commands
Previous Message Suralkar, Yogendra (Yogendra) 2022-05-20 05:53:11 Unable to connect to PostgreSQL DB as root user when private key is owned by root with permission 640