Re: BUG #14815: event trigger in extension

From: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: gomer94(at)yandex(dot)ru, PostgreSQL mailing lists <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: BUG #14815: event trigger in extension
Date: 2017-10-02 02:21:36
Message-ID: CAB7nPqSvZNtmWD5LEsZvj8vRToWnE=Orv3mWJpxnH4D62D=Uig@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Sun, Sep 17, 2017 at 4:52 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> I think the reason this fails is that on the way out of the CREATE
> EXTENSION command, the event trigger code sees that an event trigger
> exists, so it tries to call it. But because no event trigger existed
> when we started the CREATE EXTENSION command, the necessary
> infrastructure hasn't been set up --- in particular,
> EventTriggerBeginCompleteQuery did nothing at the time.

That's rather tricky, the failure happens when doing the CREATE EVENT
TRIGGER command within the CREATE EXTENSION command which is done
within ProcessUtilitySlow. I am wondering if a somewhat-elegant way to
solve such problems would be to introduce a function able to
temporarily disable and enable event triggers to happen in the context
of an extension creation, in a design similar to
pg_extension_config_dump.
--
Michael

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message drabant 2017-10-02 10:48:14 BUG #14840: Issues and bad performance with 9.6.5
Previous Message Tomas Vondra 2017-10-01 22:03:29 Re: Query planner skipping index depending on DISTINCT parameter order (2)