Re: [BUG?] pg_event_trigger_ddl_commands() error with ALTER TEXT SEARCH CONFIGURATION

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Artur Zakirov <a(dot)zakirov(at)postgrespro(dot)ru>
Cc: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [BUG?] pg_event_trigger_ddl_commands() error with ALTER TEXT SEARCH CONFIGURATION
Date: 2016-11-28 18:32:25
Message-ID: CA+TgmoZzq4L72N=R6daY8Szo-B+QKUkBmPRxQCLtBRSKj4ZR=A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sun, Nov 27, 2016 at 1:59 PM, Artur Zakirov <a(dot)zakirov(at)postgrespro(dot)ru> wrote:
> Thank you for answers.
>
> 2016-11-19 21:28 GMT+03:00 Michael Paquier <michael(dot)paquier(at)gmail(dot)com>:
>> On Thu, Nov 17, 2016 at 1:17 PM, Alvaro Herrera
>> <alvherre(at)2ndquadrant(dot)com> wrote:
>>> It's a bug. You're right that we need to handle the object class
>>> somewhere. Perhaps I failed to realize that tsconfigs could get
>>> altered.
>>
>> It seems to me that the thing to be careful of here is how a new
>> OBJECT_TSCONFIGURATIONMAP should use ObjectAddress. It does not seem
>> that complicated, but it needs some work.
>> --
>> Michael
>
> After some investigation it seems to me that OBJECT_TSCONFIGURATIONMAP
> can't be added for pg_ts_config_map. Because this catalog hasn't Oids.
>
> But this bug can be easily fixed (patch attached). I think in
> AlterTSConfiguration() TSConfigRelationId should be used instead of
> TSConfigMapRelationId. Secondly, in ProcessUtilitySlow() we can use
> commandCollected = true. Because configuration entry is added in
> EventTriggerCollectAlterTSConfig() into
> currentEventTriggerState->commandList.
>
> This patch only fixes the bug. But I think I also can do a patch which
> will give pg_ts_config_map entries with
> pg_event_trigger_ddl_commands() if someone wants. It can be done using
> new entry in the CollectedCommandType structure maybe.

You might need to add this patch to https://commitfest.postgresql.org/
so that it doesn't get forgotten.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2016-11-28 18:36:31 Re: Mail thread references in commits
Previous Message Robert Haas 2016-11-28 17:59:16 Re: Autovacuum breakage from a734fd5d1