Re: BUG #15883: Event Trigger Firing Matrix Table is incomplete

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: jeremy(at)musicsmith(dot)net, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #15883: Event Trigger Firing Matrix Table is incomplete
Date: 2019-07-28 10:45:55
Message-ID: 20190728104555.GA23790@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Hi Jeremy,

On Tue, Jul 02, 2019 at 02:57:50PM +0000, PG Bug reporting form wrote:
> The event trigger firing matrix table in the documentation:
> https://www.postgresql.org/docs/11/event-trigger-matrix.html#EVENT-TRIGGER-BY-COMMAND-TAG
> claims to list all commands for which event triggers are supported.

Sorry for the late reply.

> They are:
> - REFRESH MATERIALIZED VIEW
> - ALTER DEFAULT PRIVILEGES
> - ALTER LARGE OBJECT

There are more missing entries:
CREATE MATERIALIZED VIEW (missing for ages)
DROP MATERIALIZED VIEW (missing for ages)
ALTER MATERIALIZED VIEW (missing for ages)
CREATE ACCESS METHOD (down to 9.6)
DROP ACCESS METHOD (down to 9.6)
CREATE PROCEDURE (down to 11)
DROP PROCEDURE (down to 11)
CREATE PUBLICATION (down to 10)
ALTER PUBLICATION (down to 10)
DROP PUBLICATION (down to 10)
CREATE SUBSCRIPTION (down to 10)
ALTER SUBSCRIPTION (down to 10)
DROP SUBSCRIPTION (down to 10)
ALTER STATISTICS (down to 10)

> - DROP OWNED
> - IMPORT FOREIGN SCHEMA

These two ones are correctly listed in the table.

If you use this set of event triggers it is easy enough to check all
of them:
CREATE OR REPLACE FUNCTION log_any_command()
RETURNS event_trigger
LANGUAGE plpgsql
AS $$
BEGIN
RAISE NOTICE 'command % for event %', tg_tag, tg_event;
END;
$$;
CREATE EVENT TRIGGER ddl_start ON ddl_command_start
EXECUTE FUNCTION log_any_command();
CREATE EVENT TRIGGER ddl_end ON ddl_command_end
EXECUTE FUNCTION log_any_command();
CREATE EVENT TRIGGER ddl_drop ON sql_drop
EXECUTE FUNCTION log_any_command();
CREATE EVENT TRIGGER ddl_rewrite ON table_rewrite
EXECUTE FUNCTION log_any_command();

I'll go fix all the ones I have noticed, down to where they apply,
thanks!
--
Michael

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Daniel Migowski 2019-07-28 11:14:45 RE: BUG #15923: Prepared statements take way too much memory.
Previous Message Bruce Momjian 2019-07-28 00:47:44 Re: BUG #15916: Confusing upgrade message