Re: Collect ALTER PUBLICATION commands for event triggers

From: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
To: "Zhijie Hou (Fujitsu)" <houzj(dot)fnst(at)fujitsu(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Collect ALTER PUBLICATION commands for event triggers
Date: 2026-07-24 13:59:01
Message-ID: CAHGQGwFsLEMs1FmkK8Ff8WhD2zNiavPfpjsRHWYHgHv5638hCA@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Jul 24, 2026 at 9:03 PM Zhijie Hou (Fujitsu)
<houzj(dot)fnst(at)fujitsu(dot)com> wrote:
> I suspect this wasn't caught earlier because handling the dropped publication
> relation was sufficient to deparse it into the original ALTER PUBLICATION
> command (by combining multiple dropped items). I also assumed the primary use
> case for the event trigger was deparsing. I'm not opposed to also catching this
> command in ddl_end - I'm just curious whether it would address any additional
> use cases beyond what's already covered.

sql_drop may be sufficient for deparsing those cases. My concern is that
ddl_command_end fires, but pg_event_trigger_ddl_commands() reports
no corresponding ALTER PUBLICATION entry, which seems inconsistent
from a command-level auditing/logging perspective. So at least for me,
collecting the publication itself seems the right approach...

Regards,

--
Fujii Masao

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Chao Li 2026-07-24 14:12:07 Re: Collect ALTER PUBLICATION commands for event triggers
Previous Message Tomas Vondra 2026-07-24 13:55:58 Re: pg_class.reltuples can become non-finite and never recovers