pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: jeremy@musicsmith.net
To: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #15883: Event Trigger Firing Matrix Table is incomplete
Date: Sun, 28 Jul 2019 19:45:55 +0900
Message-ID: <20190728104555.GA23790@paquier.xyz> (raw)
In-Reply-To: <15883-afff0ea3cc2dbbb6@postgresql.org>
References: <15883-afff0ea3cc2dbbb6@postgresql.org>

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

Attachments:

  [application/pgp-signature] signature.asc (832B, ../20190728104555.GA23790@paquier.xyz/2-signature.asc)
  download

view thread (3+ messages)  latest in thread

Message-ID: <20190728104555.GA23790@paquier.xyz>
Permalink:  ../20190728104555.GA23790@paquier.xyz/
Also on:    postgresql.org/message-id/20190728104555.GA23790@paquier.xyz

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: michael@paquier.xyz, jeremy@musicsmith.net, pgsql-bugs@lists.postgresql.org
  Subject: Re: BUG #15883: Event Trigger Firing Matrix Table is incomplete
  In-Reply-To: <20190728104555.GA23790@paquier.xyz>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox