From fc7b7b849288b10605adc5f2bb3618b557ef557f Mon Sep 17 00:00:00 2001
From: Mark Dilger <mark.dilger@enterprisedb.com>
Date: Sun, 2 Feb 2020 15:42:50 -0800
Subject: [PATCH v2 3/3] Extending the event_trigger regression test.

This commit adds coverage for all command tags being used
as tags within CREATE EVENT TRIGGER.  The previous coverage
was incomplete.
---
 src/test/regress/expected/event_trigger.out | 765 +++++++++++++++++++
 src/test/regress/sql/event_trigger.sql      | 784 ++++++++++++++++++++
 2 files changed, 1549 insertions(+)

diff --git a/src/test/regress/expected/event_trigger.out b/src/test/regress/expected/event_trigger.out
index 788be86b33..9e6c845540 100644
--- a/src/test/regress/expected/event_trigger.out
+++ b/src/test/regress/expected/event_trigger.out
@@ -9,6 +9,12 @@ BEGIN
     RAISE NOTICE 'test_event_trigger: % %', tg_event, tg_tag;
 END
 $$ language plpgsql;
+-- OK
+create function test_event_trigger2() returns event_trigger as $$
+BEGIN
+	RAISE NOTICE 'test_event_trigger2: % %', tg_event, tg_tag;
+END
+$$ LANGUAGE plpgsql;
 -- should fail, event triggers cannot have declared arguments
 create function test_event_trigger_arg(name text)
 returns event_trigger as $$ BEGIN RETURN 1; END $$ language plpgsql;
@@ -80,6 +86,765 @@ create event trigger regress_event_trigger2 on ddl_command_start
    execute procedure test_event_trigger();
 -- OK
 comment on event trigger regress_event_trigger is 'test comment';
+-- These are all unsupported
+create event trigger regress_event_triger_NULL on ddl_command_start
+   when tag in ('')
+   execute procedure test_event_trigger2();
+ERROR:  filter value "" not recognized for filter variable "tag"
+create event trigger regress_event_triger_UNKNOWN on ddl_command_start
+   when tag in ('???')
+   execute procedure test_event_trigger2();
+ERROR:  filter value "???" not recognized for filter variable "tag"
+create event trigger regress_event_trigger_ALTER_DATABASE on ddl_command_start
+   when tag in ('ALTER DATABASE')
+   execute procedure test_event_trigger2();
+ERROR:  event triggers are not supported for ALTER DATABASE
+create event trigger regress_event_trigger_ALTER_EVENT_TRIGGER on ddl_command_start
+   when tag in ('ALTER EVENT TRIGGER')
+   execute procedure test_event_trigger2();
+ERROR:  event triggers are not supported for ALTER EVENT TRIGGER
+create event trigger regress_event_trigger_ALTER_ROLE on ddl_command_start
+   when tag in ('ALTER ROLE')
+   execute procedure test_event_trigger2();
+ERROR:  event triggers are not supported for ALTER ROLE
+create event trigger regress_event_trigger_ALTER_SYSTEM on ddl_command_start
+   when tag in ('ALTER SYSTEM')
+   execute procedure test_event_trigger2();
+ERROR:  event triggers are not supported for ALTER SYSTEM
+create event trigger regress_event_trigger_ALTER_TABLESPACE on ddl_command_start
+   when tag in ('ALTER TABLESPACE')
+   execute procedure test_event_trigger2();
+ERROR:  event triggers are not supported for ALTER TABLESPACE
+create event trigger regress_event_trigger_ANALYZE on ddl_command_start
+   when tag in ('ANALYZE')
+   execute procedure test_event_trigger2();
+ERROR:  event triggers are not supported for ANALYZE
+create event trigger regress_event_trigger_BEGIN on ddl_command_start
+   when tag in ('BEGIN')
+   execute procedure test_event_trigger2();
+ERROR:  event triggers are not supported for BEGIN
+create event trigger regress_event_trigger_CALL on ddl_command_start
+   when tag in ('CALL')
+   execute procedure test_event_trigger2();
+ERROR:  event triggers are not supported for CALL
+create event trigger regress_event_trigger_CHECKPOINT on ddl_command_start
+   when tag in ('CHECKPOINT')
+   execute procedure test_event_trigger2();
+ERROR:  event triggers are not supported for CHECKPOINT
+create event trigger regress_event_trigger_CLOSE on ddl_command_start
+   when tag in ('CLOSE')
+   execute procedure test_event_trigger2();
+ERROR:  event triggers are not supported for CLOSE
+create event trigger regress_event_trigger_CLOSE_CURSOR on ddl_command_start
+   when tag in ('CLOSE CURSOR')
+   execute procedure test_event_trigger2();
+ERROR:  event triggers are not supported for CLOSE CURSOR
+create event trigger regress_event_trigger_CLOSE_CURSOR_ALL on ddl_command_start
+   when tag in ('CLOSE CURSOR ALL')
+   execute procedure test_event_trigger2();
+ERROR:  event triggers are not supported for CLOSE CURSOR ALL
+create event trigger regress_event_trigger_CLUSTER on ddl_command_start
+   when tag in ('CLUSTER')
+   execute procedure test_event_trigger2();
+ERROR:  event triggers are not supported for CLUSTER
+create event trigger regress_event_trigger_COMMIT on ddl_command_start
+   when tag in ('COMMIT')
+   execute procedure test_event_trigger2();
+ERROR:  event triggers are not supported for COMMIT
+create event trigger regress_event_trigger_COMMIT_PREPARED on ddl_command_start
+   when tag in ('COMMIT PREPARED')
+   execute procedure test_event_trigger2();
+ERROR:  event triggers are not supported for COMMIT PREPARED
+create event trigger regress_event_trigger_COPY on ddl_command_start
+   when tag in ('COPY')
+   execute procedure test_event_trigger2();
+ERROR:  event triggers are not supported for COPY
+create event trigger regress_event_trigger_COPY_FROM on ddl_command_start
+   when tag in ('COPY FROM')
+   execute procedure test_event_trigger2();
+ERROR:  event triggers are not supported for COPY FROM
+create event trigger regress_event_trigger_CREATE_DATABASE on ddl_command_start
+   when tag in ('CREATE DATABASE')
+   execute procedure test_event_trigger2();
+ERROR:  event triggers are not supported for CREATE DATABASE
+create event trigger regress_event_trigger_CREATE_EVENT_TRIGGER on ddl_command_start
+   when tag in ('CREATE EVENT TRIGGER')
+   execute procedure test_event_trigger2();
+ERROR:  event triggers are not supported for CREATE EVENT TRIGGER
+create event trigger regress_event_trigger_CREATE_ROLE on ddl_command_start
+   when tag in ('CREATE ROLE')
+   execute procedure test_event_trigger2();
+ERROR:  event triggers are not supported for CREATE ROLE
+create event trigger regress_event_trigger_CREATE_TABLESPACE on ddl_command_start
+   when tag in ('CREATE TABLESPACE')
+   execute procedure test_event_trigger2();
+ERROR:  event triggers are not supported for CREATE TABLESPACE
+create event trigger regress_event_trigger_DEALLOCATE on ddl_command_start
+   when tag in ('DEALLOCATE')
+   execute procedure test_event_trigger2();
+ERROR:  event triggers are not supported for DEALLOCATE
+create event trigger regress_event_trigger_DEALLOCATE_ALL on ddl_command_start
+   when tag in ('DEALLOCATE ALL')
+   execute procedure test_event_trigger2();
+ERROR:  event triggers are not supported for DEALLOCATE ALL
+create event trigger regress_event_trigger_DECLARE_CURSOR on ddl_command_start
+   when tag in ('DECLARE CURSOR')
+   execute procedure test_event_trigger2();
+ERROR:  event triggers are not supported for DECLARE CURSOR
+create event trigger regress_event_trigger_DELETE on ddl_command_start
+   when tag in ('DELETE')
+   execute procedure test_event_trigger2();
+ERROR:  event triggers are not supported for DELETE
+create event trigger regress_event_trigger_DISCARD on ddl_command_start
+   when tag in ('DISCARD')
+   execute procedure test_event_trigger2();
+ERROR:  event triggers are not supported for DISCARD
+create event trigger regress_event_trigger_DISCARD_ALL on ddl_command_start
+   when tag in ('DISCARD ALL')
+   execute procedure test_event_trigger2();
+ERROR:  event triggers are not supported for DISCARD ALL
+create event trigger regress_event_trigger_DISCARD_PLANS on ddl_command_start
+   when tag in ('DISCARD PLANS')
+   execute procedure test_event_trigger2();
+ERROR:  event triggers are not supported for DISCARD PLANS
+create event trigger regress_event_trigger_DISCARD_SEQUENCES on ddl_command_start
+   when tag in ('DISCARD SEQUENCES')
+   execute procedure test_event_trigger2();
+ERROR:  event triggers are not supported for DISCARD SEQUENCES
+create event trigger regress_event_trigger_DISCARD_TEMP on ddl_command_start
+   when tag in ('DISCARD TEMP')
+   execute procedure test_event_trigger2();
+ERROR:  event triggers are not supported for DISCARD TEMP
+create event trigger regress_event_trigger_DO on ddl_command_start
+   when tag in ('DO')
+   execute procedure test_event_trigger2();
+ERROR:  event triggers are not supported for DO
+create event trigger regress_event_trigger_DROP_DATABASE on ddl_command_start
+   when tag in ('DROP DATABASE')
+   execute procedure test_event_trigger2();
+ERROR:  event triggers are not supported for DROP DATABASE
+create event trigger regress_event_trigger_DROP_EVENT_TRIGGER on ddl_command_start
+   when tag in ('DROP EVENT TRIGGER')
+   execute procedure test_event_trigger2();
+ERROR:  event triggers are not supported for DROP EVENT TRIGGER
+create event trigger regress_event_trigger_DROP_REPLICATION_SLOT on ddl_command_start
+   when tag in ('DROP REPLICATION SLOT')
+   execute procedure test_event_trigger2();
+ERROR:  event triggers are not supported for DROP REPLICATION SLOT
+create event trigger regress_event_trigger_DROP_ROLE on ddl_command_start
+   when tag in ('DROP ROLE')
+   execute procedure test_event_trigger2();
+ERROR:  event triggers are not supported for DROP ROLE
+create event trigger regress_event_trigger_DROP_TABLESPACE on ddl_command_start
+   when tag in ('DROP TABLESPACE')
+   execute procedure test_event_trigger2();
+ERROR:  event triggers are not supported for DROP TABLESPACE
+create event trigger regress_event_trigger_EXECUTE on ddl_command_start
+   when tag in ('EXECUTE')
+   execute procedure test_event_trigger2();
+ERROR:  event triggers are not supported for EXECUTE
+create event trigger regress_event_trigger_EXPLAIN on ddl_command_start
+   when tag in ('EXPLAIN')
+   execute procedure test_event_trigger2();
+ERROR:  event triggers are not supported for EXPLAIN
+create event trigger regress_event_trigger_FETCH on ddl_command_start
+   when tag in ('FETCH')
+   execute procedure test_event_trigger2();
+ERROR:  event triggers are not supported for FETCH
+create event trigger regress_event_trigger_GRANT_ROLE on ddl_command_start
+   when tag in ('GRANT ROLE')
+   execute procedure test_event_trigger2();
+ERROR:  event triggers are not supported for GRANT ROLE
+create event trigger regress_event_trigger_INSERT on ddl_command_start
+   when tag in ('INSERT')
+   execute procedure test_event_trigger2();
+ERROR:  event triggers are not supported for INSERT
+create event trigger regress_event_trigger_LISTEN on ddl_command_start
+   when tag in ('LISTEN')
+   execute procedure test_event_trigger2();
+ERROR:  event triggers are not supported for LISTEN
+create event trigger regress_event_trigger_LOAD on ddl_command_start
+   when tag in ('LOAD')
+   execute procedure test_event_trigger2();
+ERROR:  event triggers are not supported for LOAD
+create event trigger regress_event_trigger_LOCK_TABLE on ddl_command_start
+   when tag in ('LOCK TABLE')
+   execute procedure test_event_trigger2();
+ERROR:  event triggers are not supported for LOCK TABLE
+create event trigger regress_event_trigger_MOVE on ddl_command_start
+   when tag in ('MOVE')
+   execute procedure test_event_trigger2();
+ERROR:  event triggers are not supported for MOVE
+create event trigger regress_event_trigger_NOTIFY on ddl_command_start
+   when tag in ('NOTIFY')
+   execute procedure test_event_trigger2();
+ERROR:  event triggers are not supported for NOTIFY
+create event trigger regress_event_trigger_PREPARE on ddl_command_start
+   when tag in ('PREPARE')
+   execute procedure test_event_trigger2();
+ERROR:  event triggers are not supported for PREPARE
+create event trigger regress_event_trigger_PREPARE_TRANSACTION on ddl_command_start
+   when tag in ('PREPARE TRANSACTION')
+   execute procedure test_event_trigger2();
+ERROR:  event triggers are not supported for PREPARE TRANSACTION
+create event trigger regress_event_trigger_REASSIGN_OWNED on ddl_command_start
+   when tag in ('REASSIGN OWNED')
+   execute procedure test_event_trigger2();
+ERROR:  event triggers are not supported for REASSIGN OWNED
+create event trigger regress_event_trigger_REINDEX on ddl_command_start
+   when tag in ('REINDEX')
+   execute procedure test_event_trigger2();
+ERROR:  event triggers are not supported for REINDEX
+create event trigger regress_event_trigger_RELEASE on ddl_command_start
+   when tag in ('RELEASE')
+   execute procedure test_event_trigger2();
+ERROR:  event triggers are not supported for RELEASE
+create event trigger regress_event_trigger_RESET on ddl_command_start
+   when tag in ('RESET')
+   execute procedure test_event_trigger2();
+ERROR:  event triggers are not supported for RESET
+create event trigger regress_event_trigger_REVOKE on ddl_command_start
+   when tag in ('REVOKE')
+   execute procedure test_event_trigger2();
+create event trigger regress_event_trigger_REVOKE_ROLE on ddl_command_start
+   when tag in ('REVOKE ROLE')
+   execute procedure test_event_trigger2();
+ERROR:  event triggers are not supported for REVOKE ROLE
+create event trigger regress_event_trigger_ROLLBACK on ddl_command_start
+   when tag in ('ROLLBACK')
+   execute procedure test_event_trigger2();
+ERROR:  event triggers are not supported for ROLLBACK
+create event trigger regress_event_trigger_ROLLBACK_PREPARED on ddl_command_start
+   when tag in ('ROLLBACK PREPARED')
+   execute procedure test_event_trigger2();
+ERROR:  event triggers are not supported for ROLLBACK PREPARED
+create event trigger regress_event_trigger_SAVEPOINT on ddl_command_start
+   when tag in ('SAVEPOINT')
+   execute procedure test_event_trigger2();
+ERROR:  event triggers are not supported for SAVEPOINT
+create event trigger regress_event_trigger_SECURITY_LABEL on ddl_command_start
+   when tag in ('SECURITY LABEL')
+   execute procedure test_event_trigger2();
+create event trigger regress_event_trigger_SELECT on ddl_command_start
+   when tag in ('SELECT')
+   execute procedure test_event_trigger2();
+ERROR:  event triggers are not supported for SELECT
+create event trigger regress_event_trigger_SELECT_FOR_KEY_SHARE on ddl_command_start
+   when tag in ('SELECT FOR KEY SHARE')
+   execute procedure test_event_trigger2();
+ERROR:  event triggers are not supported for SELECT FOR KEY SHARE
+create event trigger regress_event_trigger_SELECT_FOR_NO_KEY_UPDATE on ddl_command_start
+   when tag in ('SELECT FOR NO KEY UPDATE')
+   execute procedure test_event_trigger2();
+ERROR:  event triggers are not supported for SELECT FOR NO KEY UPDATE
+create event trigger regress_event_trigger_SELECT_FOR_SHARE on ddl_command_start
+   when tag in ('SELECT FOR SHARE')
+   execute procedure test_event_trigger2();
+ERROR:  event triggers are not supported for SELECT FOR SHARE
+create event trigger regress_event_trigger_SELECT_FOR_UPDATE on ddl_command_start
+   when tag in ('SELECT FOR UPDATE')
+   execute procedure test_event_trigger2();
+ERROR:  event triggers are not supported for SELECT FOR UPDATE
+create event trigger regress_event_trigger_SET on ddl_command_start
+   when tag in ('SET')
+   execute procedure test_event_trigger2();
+ERROR:  event triggers are not supported for SET
+create event trigger regress_event_trigger_SET_CONSTRAINTS on ddl_command_start
+   when tag in ('SET CONSTRAINTS')
+   execute procedure test_event_trigger2();
+ERROR:  event triggers are not supported for SET CONSTRAINTS
+create event trigger regress_event_trigger_SHOW on ddl_command_start
+   when tag in ('SHOW')
+   execute procedure test_event_trigger2();
+ERROR:  event triggers are not supported for SHOW
+create event trigger regress_event_trigger_START_TRANSACTION on ddl_command_start
+   when tag in ('START TRANSACTION')
+   execute procedure test_event_trigger2();
+ERROR:  event triggers are not supported for START TRANSACTION
+create event trigger regress_event_trigger_TRUNCATE_TABLE on ddl_command_start
+   when tag in ('TRUNCATE TABLE')
+   execute procedure test_event_trigger2();
+ERROR:  event triggers are not supported for TRUNCATE TABLE
+create event trigger regress_event_trigger_UNLISTEN on ddl_command_start
+   when tag in ('UNLISTEN')
+   execute procedure test_event_trigger2();
+ERROR:  event triggers are not supported for UNLISTEN
+create event trigger regress_event_trigger_UPDATE on ddl_command_start
+   when tag in ('UPDATE')
+   execute procedure test_event_trigger2();
+ERROR:  event triggers are not supported for UPDATE
+create event trigger regress_event_trigger_VACUUM on ddl_command_start
+   when tag in ('VACUUM')
+   execute procedure test_event_trigger2();
+ERROR:  event triggers are not supported for VACUUM
+-- These are all ok
+create event trigger regress_event_trigger_ALTER_ACCESS_METHOD on ddl_command_start
+   when tag in ('ALTER ACCESS METHOD')
+   execute procedure test_event_trigger2();
+create event trigger regress_event_trigger_ALTER_AGGREGATE on ddl_command_start
+   when tag in ('ALTER AGGREGATE')
+   execute procedure test_event_trigger2();
+create event trigger regress_event_trigger_ALTER_CAST on ddl_command_start
+   when tag in ('ALTER CAST')
+   execute procedure test_event_trigger2();
+create event trigger regress_event_trigger_ALTER_COLLATION on ddl_command_start
+   when tag in ('ALTER COLLATION')
+   execute procedure test_event_trigger2();
+create event trigger regress_event_trigger_ALTER_CONSTRAINT on ddl_command_start
+   when tag in ('ALTER CONSTRAINT')
+   execute procedure test_event_trigger2();
+create event trigger regress_event_trigger_ALTER_CONVERSION on ddl_command_start
+   when tag in ('ALTER CONVERSION')
+   execute procedure test_event_trigger2();
+create event trigger regress_event_trigger_ALTER_DEFAULT_PRIVILEGES on ddl_command_start
+   when tag in ('ALTER DEFAULT PRIVILEGES')
+   execute procedure test_event_trigger2();
+create event trigger regress_event_trigger_ALTER_DOMAIN on ddl_command_start
+   when tag in ('ALTER DOMAIN')
+   execute procedure test_event_trigger2();
+create event trigger regress_event_trigger_ALTER_EXTENSION on ddl_command_start
+   when tag in ('ALTER EXTENSION')
+   execute procedure test_event_trigger2();
+create event trigger regress_event_trigger_ALTER_FOREIGN_DATA_WRAPPER on ddl_command_start
+   when tag in ('ALTER FOREIGN DATA WRAPPER')
+   execute procedure test_event_trigger2();
+create event trigger regress_event_trigger_ALTER_FOREIGN_TABLE on ddl_command_start
+   when tag in ('ALTER FOREIGN TABLE')
+   execute procedure test_event_trigger2();
+create event trigger regress_event_trigger_ALTER_FUNCTION on ddl_command_start
+   when tag in ('ALTER FUNCTION')
+   execute procedure test_event_trigger2();
+create event trigger regress_event_trigger_ALTER_INDEX on ddl_command_start
+   when tag in ('ALTER INDEX')
+   execute procedure test_event_trigger2();
+create event trigger regress_event_trigger_ALTER_LANGUAGE on ddl_command_start
+   when tag in ('ALTER LANGUAGE')
+   execute procedure test_event_trigger2();
+create event trigger regress_event_trigger_ALTER_LARGE_OBJECT on ddl_command_start
+   when tag in ('ALTER LARGE OBJECT')
+   execute procedure test_event_trigger2();
+create event trigger regress_event_trigger_ALTER_MATERIALIZED_VIEW on ddl_command_start
+   when tag in ('ALTER MATERIALIZED VIEW')
+   execute procedure test_event_trigger2();
+create event trigger regress_event_trigger_ALTER_OPERATOR on ddl_command_start
+   when tag in ('ALTER OPERATOR')
+   execute procedure test_event_trigger2();
+create event trigger regress_event_trigger_ALTER_OPERATOR_CLASS on ddl_command_start
+   when tag in ('ALTER OPERATOR CLASS')
+   execute procedure test_event_trigger2();
+create event trigger regress_event_trigger_ALTER_OPERATOR_FAMILY on ddl_command_start
+   when tag in ('ALTER OPERATOR FAMILY')
+   execute procedure test_event_trigger2();
+create event trigger regress_event_trigger_ALTER_POLICY on ddl_command_start
+   when tag in ('ALTER POLICY')
+   execute procedure test_event_trigger2();
+create event trigger regress_event_trigger_ALTER_PROCEDURE on ddl_command_start
+   when tag in ('ALTER PROCEDURE')
+   execute procedure test_event_trigger2();
+create event trigger regress_event_trigger_ALTER_PUBLICATION on ddl_command_start
+   when tag in ('ALTER PUBLICATION')
+   execute procedure test_event_trigger2();
+create event trigger regress_event_trigger_ALTER_ROUTINE on ddl_command_start
+   when tag in ('ALTER ROUTINE')
+   execute procedure test_event_trigger2();
+create event trigger regress_event_trigger_ALTER_RULE on ddl_command_start
+   when tag in ('ALTER RULE')
+   execute procedure test_event_trigger2();
+create event trigger regress_event_trigger_ALTER_SCHEMA on ddl_command_start
+   when tag in ('ALTER SCHEMA')
+   execute procedure test_event_trigger2();
+create event trigger regress_event_trigger_ALTER_SEQUENCE on ddl_command_start
+   when tag in ('ALTER SEQUENCE')
+   execute procedure test_event_trigger2();
+create event trigger regress_event_trigger_ALTER_SERVER on ddl_command_start
+   when tag in ('ALTER SERVER')
+   execute procedure test_event_trigger2();
+create event trigger regress_event_trigger_ALTER_STATISTICS on ddl_command_start
+   when tag in ('ALTER STATISTICS')
+   execute procedure test_event_trigger2();
+create event trigger regress_event_trigger_ALTER_SUBSCRIPTION on ddl_command_start
+   when tag in ('ALTER SUBSCRIPTION')
+   execute procedure test_event_trigger2();
+create event trigger regress_event_trigger_ALTER_TABLE on ddl_command_start
+   when tag in ('ALTER TABLE')
+   execute procedure test_event_trigger2();
+create event trigger regress_event_trigger_ALTER_TEXT_SEARCH_CONFIGURATION on ddl_command_start
+   when tag in ('ALTER TEXT SEARCH CONFIGURATION')
+   execute procedure test_event_trigger2();
+create event trigger regress_event_trigger_ALTER_TEXT_SEARCH_DICTIONARY on ddl_command_start
+   when tag in ('ALTER TEXT SEARCH DICTIONARY')
+   execute procedure test_event_trigger2();
+create event trigger regress_event_trigger_ALTER_TEXT_SEARCH_PARSER on ddl_command_start
+   when tag in ('ALTER TEXT SEARCH PARSER')
+   execute procedure test_event_trigger2();
+create event trigger regress_event_trigger_ALTER_TEXT_SEARCH_TEMPLATE on ddl_command_start
+   when tag in ('ALTER TEXT SEARCH TEMPLATE')
+   execute procedure test_event_trigger2();
+create event trigger regress_event_trigger_ALTER_TRANSFORM on ddl_command_start
+   when tag in ('ALTER TRANSFORM')
+   execute procedure test_event_trigger2();
+create event trigger regress_event_trigger_ALTER_TRIGGER on ddl_command_start
+   when tag in ('ALTER TRIGGER')
+   execute procedure test_event_trigger2();
+create event trigger regress_event_trigger_ALTER_TYPE on ddl_command_start
+   when tag in ('ALTER TYPE')
+   execute procedure test_event_trigger2();
+create event trigger regress_event_trigger_ALTER_USER_MAPPING on ddl_command_start
+   when tag in ('ALTER USER MAPPING')
+   execute procedure test_event_trigger2();
+create event trigger regress_event_trigger_ALTER_VIEW on ddl_command_start
+   when tag in ('ALTER VIEW')
+   execute procedure test_event_trigger2();
+create event trigger regress_event_trigger_COMMENT on ddl_command_start
+   when tag in ('COMMENT')
+   execute procedure test_event_trigger2();
+create event trigger regress_event_trigger_CREATE_ACCESS_METHOD on ddl_command_start
+   when tag in ('CREATE ACCESS METHOD')
+   execute procedure test_event_trigger2();
+create event trigger regress_event_trigger_CREATE_AGGREGATE on ddl_command_start
+   when tag in ('CREATE AGGREGATE')
+   execute procedure test_event_trigger2();
+create event trigger regress_event_trigger_CREATE_CAST on ddl_command_start
+   when tag in ('CREATE CAST')
+   execute procedure test_event_trigger2();
+create event trigger regress_event_trigger_CREATE_COLLATION on ddl_command_start
+   when tag in ('CREATE COLLATION')
+   execute procedure test_event_trigger2();
+create event trigger regress_event_trigger_CREATE_CONSTRAINT on ddl_command_start
+   when tag in ('CREATE CONSTRAINT')
+   execute procedure test_event_trigger2();
+create event trigger regress_event_trigger_CREATE_CONVERSION on ddl_command_start
+   when tag in ('CREATE CONVERSION')
+   execute procedure test_event_trigger2();
+create event trigger regress_event_trigger_CREATE_DOMAIN on ddl_command_start
+   when tag in ('CREATE DOMAIN')
+   execute procedure test_event_trigger2();
+create event trigger regress_event_trigger_CREATE_EXTENSION on ddl_command_start
+   when tag in ('CREATE EXTENSION')
+   execute procedure test_event_trigger2();
+create event trigger regress_event_trigger_CREATE_FOREIGN_DATA_WRAPPER on ddl_command_start
+   when tag in ('CREATE FOREIGN DATA WRAPPER')
+   execute procedure test_event_trigger2();
+create event trigger regress_event_trigger_CREATE_FOREIGN_TABLE on ddl_command_start
+   when tag in ('CREATE FOREIGN TABLE')
+   execute procedure test_event_trigger2();
+create event trigger regress_event_trigger_CREATE_FUNCTION on ddl_command_start
+   when tag in ('CREATE FUNCTION')
+   execute procedure test_event_trigger2();
+create event trigger regress_event_trigger_CREATE_INDEX on ddl_command_start
+   when tag in ('CREATE INDEX')
+   execute procedure test_event_trigger2();
+create event trigger regress_event_trigger_CREATE_LANGUAGE on ddl_command_start
+   when tag in ('CREATE LANGUAGE')
+   execute procedure test_event_trigger2();
+create event trigger regress_event_trigger_CREATE_MATERIALIZED_VIEW on ddl_command_start
+   when tag in ('CREATE MATERIALIZED VIEW')
+   execute procedure test_event_trigger2();
+create event trigger regress_event_trigger_CREATE_OPERATOR on ddl_command_start
+   when tag in ('CREATE OPERATOR')
+   execute procedure test_event_trigger2();
+create event trigger regress_event_trigger_CREATE_OPERATOR_CLASS on ddl_command_start
+   when tag in ('CREATE OPERATOR CLASS')
+   execute procedure test_event_trigger2();
+create event trigger regress_event_trigger_CREATE_OPERATOR_FAMILY on ddl_command_start
+   when tag in ('CREATE OPERATOR FAMILY')
+   execute procedure test_event_trigger2();
+create event trigger regress_event_trigger_CREATE_POLICY on ddl_command_start
+   when tag in ('CREATE POLICY')
+   execute procedure test_event_trigger2();
+create event trigger regress_event_trigger_CREATE_PROCEDURE on ddl_command_start
+   when tag in ('CREATE PROCEDURE')
+   execute procedure test_event_trigger2();
+create event trigger regress_event_trigger_CREATE_PUBLICATION on ddl_command_start
+   when tag in ('CREATE PUBLICATION')
+   execute procedure test_event_trigger2();
+create event trigger regress_event_trigger_CREATE_ROUTINE on ddl_command_start
+   when tag in ('CREATE ROUTINE')
+   execute procedure test_event_trigger2();
+create event trigger regress_event_trigger_CREATE_RULE on ddl_command_start
+   when tag in ('CREATE RULE')
+   execute procedure test_event_trigger2();
+create event trigger regress_event_trigger_CREATE_SCHEMA on ddl_command_start
+   when tag in ('CREATE SCHEMA')
+   execute procedure test_event_trigger2();
+create event trigger regress_event_trigger_CREATE_SEQUENCE on ddl_command_start
+   when tag in ('CREATE SEQUENCE')
+   execute procedure test_event_trigger2();
+create event trigger regress_event_trigger_CREATE_SERVER on ddl_command_start
+   when tag in ('CREATE SERVER')
+   execute procedure test_event_trigger2();
+create event trigger regress_event_trigger_CREATE_STATISTICS on ddl_command_start
+   when tag in ('CREATE STATISTICS')
+   execute procedure test_event_trigger2();
+create event trigger regress_event_trigger_CREATE_SUBSCRIPTION on ddl_command_start
+   when tag in ('CREATE SUBSCRIPTION')
+   execute procedure test_event_trigger2();
+create event trigger regress_event_trigger_CREATE_TABLE on ddl_command_start
+   when tag in ('CREATE TABLE')
+   execute procedure test_event_trigger2();
+create event trigger regress_event_trigger_CREATE_TABLE_AS on ddl_command_start
+   when tag in ('CREATE TABLE AS')
+   execute procedure test_event_trigger2();
+create event trigger regress_event_trigger_CREATE_TEXT_SEARCH_CONFIGURATION on ddl_command_start
+   when tag in ('CREATE TEXT SEARCH CONFIGURATION')
+   execute procedure test_event_trigger2();
+create event trigger regress_event_trigger_CREATE_TEXT_SEARCH_DICTIONARY on ddl_command_start
+   when tag in ('CREATE TEXT SEARCH DICTIONARY')
+   execute procedure test_event_trigger2();
+create event trigger regress_event_trigger_CREATE_TEXT_SEARCH_PARSER on ddl_command_start
+   when tag in ('CREATE TEXT SEARCH PARSER')
+   execute procedure test_event_trigger2();
+create event trigger regress_event_trigger_CREATE_TEXT_SEARCH_TEMPLATE on ddl_command_start
+   when tag in ('CREATE TEXT SEARCH TEMPLATE')
+   execute procedure test_event_trigger2();
+create event trigger regress_event_trigger_CREATE_TRANSFORM on ddl_command_start
+   when tag in ('CREATE TRANSFORM')
+   execute procedure test_event_trigger2();
+create event trigger regress_event_trigger_CREATE_TRIGGER on ddl_command_start
+   when tag in ('CREATE TRIGGER')
+   execute procedure test_event_trigger2();
+create event trigger regress_event_trigger_CREATE_TYPE on ddl_command_start
+   when tag in ('CREATE TYPE')
+   execute procedure test_event_trigger2();
+create event trigger regress_event_trigger_CREATE_USER_MAPPING on ddl_command_start
+   when tag in ('CREATE USER MAPPING')
+   execute procedure test_event_trigger2();
+create event trigger regress_event_trigger_CREATE_VIEW on ddl_command_start
+   when tag in ('CREATE VIEW')
+   execute procedure test_event_trigger2();
+create event trigger regress_event_trigger_DROP_ACCESS_METHOD on ddl_command_start
+   when tag in ('DROP ACCESS METHOD')
+   execute procedure test_event_trigger2();
+create event trigger regress_event_trigger_DROP_AGGREGATE on ddl_command_start
+   when tag in ('DROP AGGREGATE')
+   execute procedure test_event_trigger2();
+create event trigger regress_event_trigger_DROP_CAST on ddl_command_start
+   when tag in ('DROP CAST')
+   execute procedure test_event_trigger2();
+create event trigger regress_event_trigger_DROP_COLLATION on ddl_command_start
+   when tag in ('DROP COLLATION')
+   execute procedure test_event_trigger2();
+create event trigger regress_event_trigger_DROP_CONSTRAINT on ddl_command_start
+   when tag in ('DROP CONSTRAINT')
+   execute procedure test_event_trigger2();
+create event trigger regress_event_trigger_DROP_CONVERSION on ddl_command_start
+   when tag in ('DROP CONVERSION')
+   execute procedure test_event_trigger2();
+create event trigger regress_event_trigger_DROP_DOMAIN on ddl_command_start
+   when tag in ('DROP DOMAIN')
+   execute procedure test_event_trigger2();
+create event trigger regress_event_trigger_DROP_EXTENSION on ddl_command_start
+   when tag in ('DROP EXTENSION')
+   execute procedure test_event_trigger2();
+create event trigger regress_event_trigger_DROP_FOREIGN_DATA_WRAPPER on ddl_command_start
+   when tag in ('DROP FOREIGN DATA WRAPPER')
+   execute procedure test_event_trigger2();
+create event trigger regress_event_trigger_DROP_FOREIGN_TABLE on ddl_command_start
+   when tag in ('DROP FOREIGN TABLE')
+   execute procedure test_event_trigger2();
+create event trigger regress_event_trigger_DROP_FUNCTION on ddl_command_start
+   when tag in ('DROP FUNCTION')
+   execute procedure test_event_trigger2();
+create event trigger regress_event_trigger_DROP_INDEX on ddl_command_start
+   when tag in ('DROP INDEX')
+   execute procedure test_event_trigger2();
+create event trigger regress_event_trigger_DROP_LANGUAGE on ddl_command_start
+   when tag in ('DROP LANGUAGE')
+   execute procedure test_event_trigger2();
+create event trigger regress_event_trigger_DROP_MATERIALIZED_VIEW on ddl_command_start
+   when tag in ('DROP MATERIALIZED VIEW')
+   execute procedure test_event_trigger2();
+create event trigger regress_event_trigger_DROP_OPERATOR on ddl_command_start
+   when tag in ('DROP OPERATOR')
+   execute procedure test_event_trigger2();
+create event trigger regress_event_trigger_DROP_OPERATOR_CLASS on ddl_command_start
+   when tag in ('DROP OPERATOR CLASS')
+   execute procedure test_event_trigger2();
+create event trigger regress_event_trigger_DROP_OPERATOR_FAMILY on ddl_command_start
+   when tag in ('DROP OPERATOR FAMILY')
+   execute procedure test_event_trigger2();
+create event trigger regress_event_trigger_DROP_OWNED on ddl_command_start
+   when tag in ('DROP OWNED')
+   execute procedure test_event_trigger2();
+create event trigger regress_event_trigger_DROP_POLICY on ddl_command_start
+   when tag in ('DROP POLICY')
+   execute procedure test_event_trigger2();
+create event trigger regress_event_trigger_DROP_PROCEDURE on ddl_command_start
+   when tag in ('DROP PROCEDURE')
+   execute procedure test_event_trigger2();
+create event trigger regress_event_trigger_DROP_PUBLICATION on ddl_command_start
+   when tag in ('DROP PUBLICATION')
+   execute procedure test_event_trigger2();
+create event trigger regress_event_trigger_DROP_ROUTINE on ddl_command_start
+   when tag in ('DROP ROUTINE')
+   execute procedure test_event_trigger2();
+create event trigger regress_event_trigger_DROP_RULE on ddl_command_start
+   when tag in ('DROP RULE')
+   execute procedure test_event_trigger2();
+create event trigger regress_event_trigger_DROP_SCHEMA on ddl_command_start
+   when tag in ('DROP SCHEMA')
+   execute procedure test_event_trigger2();
+create event trigger regress_event_trigger_DROP_SEQUENCE on ddl_command_start
+   when tag in ('DROP SEQUENCE')
+   execute procedure test_event_trigger2();
+create event trigger regress_event_trigger_DROP_SERVER on ddl_command_start
+   when tag in ('DROP SERVER')
+   execute procedure test_event_trigger2();
+create event trigger regress_event_trigger_DROP_STATISTICS on ddl_command_start
+   when tag in ('DROP STATISTICS')
+   execute procedure test_event_trigger2();
+create event trigger regress_event_trigger_DROP_SUBSCRIPTION on ddl_command_start
+   when tag in ('DROP SUBSCRIPTION')
+   execute procedure test_event_trigger2();
+create event trigger regress_event_trigger_DROP_TABLE on ddl_command_start
+   when tag in ('DROP TABLE')
+   execute procedure test_event_trigger2();
+create event trigger regress_event_trigger_DROP_TEXT_SEARCH_CONFIGURATION on ddl_command_start
+   when tag in ('DROP TEXT SEARCH CONFIGURATION')
+   execute procedure test_event_trigger2();
+create event trigger regress_event_trigger_DROP_TEXT_SEARCH_DICTIONARY on ddl_command_start
+   when tag in ('DROP TEXT SEARCH DICTIONARY')
+   execute procedure test_event_trigger2();
+create event trigger regress_event_trigger_DROP_TEXT_SEARCH_PARSER on ddl_command_start
+   when tag in ('DROP TEXT SEARCH PARSER')
+   execute procedure test_event_trigger2();
+create event trigger regress_event_trigger_DROP_TEXT_SEARCH_TEMPLATE on ddl_command_start
+   when tag in ('DROP TEXT SEARCH TEMPLATE')
+   execute procedure test_event_trigger2();
+create event trigger regress_event_trigger_DROP_TRANSFORM on ddl_command_start
+   when tag in ('DROP TRANSFORM')
+   execute procedure test_event_trigger2();
+create event trigger regress_event_trigger_DROP_TRIGGER on ddl_command_start
+   when tag in ('DROP TRIGGER')
+   execute procedure test_event_trigger2();
+create event trigger regress_event_trigger_DROP_TYPE on ddl_command_start
+   when tag in ('DROP TYPE')
+   execute procedure test_event_trigger2();
+create event trigger regress_event_trigger_DROP_USER_MAPPING on ddl_command_start
+   when tag in ('DROP USER MAPPING')
+   execute procedure test_event_trigger2();
+create event trigger regress_event_trigger_DROP_VIEW on ddl_command_start
+   when tag in ('DROP VIEW')
+   execute procedure test_event_trigger2();
+create event trigger regress_event_trigger_GRANT on ddl_command_start
+   when tag in ('GRANT')
+   execute procedure test_event_trigger2();
+create event trigger regress_event_trigger_IMPORT_FOREIGN_SCHEMA on ddl_command_start
+   when tag in ('IMPORT FOREIGN SCHEMA')
+   execute procedure test_event_trigger2();
+create event trigger regress_event_trigger_REFRESH_MATERIALIZED_VIEW on ddl_command_start
+   when tag in ('REFRESH MATERIALIZED VIEW')
+   execute procedure test_event_trigger2();
+create event trigger regress_event_trigger_SELECT_INTO on ddl_command_start
+   when tag in ('SELECT INTO')
+   execute procedure test_event_trigger2();
+-- drop should cascade to the event trigger
+drop function test_event_trigger2() cascade;
+NOTICE:  test_event_trigger: ddl_command_start DROP FUNCTION
+NOTICE:  test_event_trigger2: ddl_command_start DROP FUNCTION
+NOTICE:  drop cascades to 122 other objects
+DETAIL:  drop cascades to event trigger regress_event_trigger_revoke
+drop cascades to event trigger regress_event_trigger_security_label
+drop cascades to event trigger regress_event_trigger_alter_access_method
+drop cascades to event trigger regress_event_trigger_alter_aggregate
+drop cascades to event trigger regress_event_trigger_alter_cast
+drop cascades to event trigger regress_event_trigger_alter_collation
+drop cascades to event trigger regress_event_trigger_alter_constraint
+drop cascades to event trigger regress_event_trigger_alter_conversion
+drop cascades to event trigger regress_event_trigger_alter_default_privileges
+drop cascades to event trigger regress_event_trigger_alter_domain
+drop cascades to event trigger regress_event_trigger_alter_extension
+drop cascades to event trigger regress_event_trigger_alter_foreign_data_wrapper
+drop cascades to event trigger regress_event_trigger_alter_foreign_table
+drop cascades to event trigger regress_event_trigger_alter_function
+drop cascades to event trigger regress_event_trigger_alter_index
+drop cascades to event trigger regress_event_trigger_alter_language
+drop cascades to event trigger regress_event_trigger_alter_large_object
+drop cascades to event trigger regress_event_trigger_alter_materialized_view
+drop cascades to event trigger regress_event_trigger_alter_operator
+drop cascades to event trigger regress_event_trigger_alter_operator_class
+drop cascades to event trigger regress_event_trigger_alter_operator_family
+drop cascades to event trigger regress_event_trigger_alter_policy
+drop cascades to event trigger regress_event_trigger_alter_procedure
+drop cascades to event trigger regress_event_trigger_alter_publication
+drop cascades to event trigger regress_event_trigger_alter_routine
+drop cascades to event trigger regress_event_trigger_alter_rule
+drop cascades to event trigger regress_event_trigger_alter_schema
+drop cascades to event trigger regress_event_trigger_alter_sequence
+drop cascades to event trigger regress_event_trigger_alter_server
+drop cascades to event trigger regress_event_trigger_alter_statistics
+drop cascades to event trigger regress_event_trigger_alter_subscription
+drop cascades to event trigger regress_event_trigger_alter_table
+drop cascades to event trigger regress_event_trigger_alter_text_search_configuration
+drop cascades to event trigger regress_event_trigger_alter_text_search_dictionary
+drop cascades to event trigger regress_event_trigger_alter_text_search_parser
+drop cascades to event trigger regress_event_trigger_alter_text_search_template
+drop cascades to event trigger regress_event_trigger_alter_transform
+drop cascades to event trigger regress_event_trigger_alter_trigger
+drop cascades to event trigger regress_event_trigger_alter_type
+drop cascades to event trigger regress_event_trigger_alter_user_mapping
+drop cascades to event trigger regress_event_trigger_alter_view
+drop cascades to event trigger regress_event_trigger_comment
+drop cascades to event trigger regress_event_trigger_create_access_method
+drop cascades to event trigger regress_event_trigger_create_aggregate
+drop cascades to event trigger regress_event_trigger_create_cast
+drop cascades to event trigger regress_event_trigger_create_collation
+drop cascades to event trigger regress_event_trigger_create_constraint
+drop cascades to event trigger regress_event_trigger_create_conversion
+drop cascades to event trigger regress_event_trigger_create_domain
+drop cascades to event trigger regress_event_trigger_create_extension
+drop cascades to event trigger regress_event_trigger_create_foreign_data_wrapper
+drop cascades to event trigger regress_event_trigger_create_foreign_table
+drop cascades to event trigger regress_event_trigger_create_function
+drop cascades to event trigger regress_event_trigger_create_index
+drop cascades to event trigger regress_event_trigger_create_language
+drop cascades to event trigger regress_event_trigger_create_materialized_view
+drop cascades to event trigger regress_event_trigger_create_operator
+drop cascades to event trigger regress_event_trigger_create_operator_class
+drop cascades to event trigger regress_event_trigger_create_operator_family
+drop cascades to event trigger regress_event_trigger_create_policy
+drop cascades to event trigger regress_event_trigger_create_procedure
+drop cascades to event trigger regress_event_trigger_create_publication
+drop cascades to event trigger regress_event_trigger_create_routine
+drop cascades to event trigger regress_event_trigger_create_rule
+drop cascades to event trigger regress_event_trigger_create_schema
+drop cascades to event trigger regress_event_trigger_create_sequence
+drop cascades to event trigger regress_event_trigger_create_server
+drop cascades to event trigger regress_event_trigger_create_statistics
+drop cascades to event trigger regress_event_trigger_create_subscription
+drop cascades to event trigger regress_event_trigger_create_table
+drop cascades to event trigger regress_event_trigger_create_table_as
+drop cascades to event trigger regress_event_trigger_create_text_search_configuration
+drop cascades to event trigger regress_event_trigger_create_text_search_dictionary
+drop cascades to event trigger regress_event_trigger_create_text_search_parser
+drop cascades to event trigger regress_event_trigger_create_text_search_template
+drop cascades to event trigger regress_event_trigger_create_transform
+drop cascades to event trigger regress_event_trigger_create_trigger
+drop cascades to event trigger regress_event_trigger_create_type
+drop cascades to event trigger regress_event_trigger_create_user_mapping
+drop cascades to event trigger regress_event_trigger_create_view
+drop cascades to event trigger regress_event_trigger_drop_access_method
+drop cascades to event trigger regress_event_trigger_drop_aggregate
+drop cascades to event trigger regress_event_trigger_drop_cast
+drop cascades to event trigger regress_event_trigger_drop_collation
+drop cascades to event trigger regress_event_trigger_drop_constraint
+drop cascades to event trigger regress_event_trigger_drop_conversion
+drop cascades to event trigger regress_event_trigger_drop_domain
+drop cascades to event trigger regress_event_trigger_drop_extension
+drop cascades to event trigger regress_event_trigger_drop_foreign_data_wrapper
+drop cascades to event trigger regress_event_trigger_drop_foreign_table
+drop cascades to event trigger regress_event_trigger_drop_function
+drop cascades to event trigger regress_event_trigger_drop_index
+drop cascades to event trigger regress_event_trigger_drop_language
+drop cascades to event trigger regress_event_trigger_drop_materialized_view
+drop cascades to event trigger regress_event_trigger_drop_operator
+drop cascades to event trigger regress_event_trigger_drop_operator_class
+drop cascades to event trigger regress_event_trigger_drop_operator_family
+drop cascades to event trigger regress_event_trigger_drop_owned
+drop cascades to event trigger regress_event_trigger_drop_policy
+drop cascades to event trigger regress_event_trigger_drop_procedure
+and 22 other objects (see server log for list)
+NOTICE:  test_event_trigger: ddl_command_end DROP FUNCTION
 -- drop as non-superuser should fail
 create role regress_evt_user;
 set role regress_evt_user;
diff --git a/src/test/regress/sql/event_trigger.sql b/src/test/regress/sql/event_trigger.sql
index 346168673d..cad02212ad 100644
--- a/src/test/regress/sql/event_trigger.sql
+++ b/src/test/regress/sql/event_trigger.sql
@@ -10,6 +10,13 @@ BEGIN
 END
 $$ language plpgsql;
 
+-- OK
+create function test_event_trigger2() returns event_trigger as $$
+BEGIN
+	RAISE NOTICE 'test_event_trigger2: % %', tg_event, tg_tag;
+END
+$$ LANGUAGE plpgsql;
+
 -- should fail, event triggers cannot have declared arguments
 create function test_event_trigger_arg(name text)
 returns event_trigger as $$ BEGIN RETURN 1; END $$ language plpgsql;
@@ -82,6 +89,783 @@ create event trigger regress_event_trigger2 on ddl_command_start
 -- OK
 comment on event trigger regress_event_trigger is 'test comment';
 
+-- These are all unsupported
+create event trigger regress_event_triger_NULL on ddl_command_start
+   when tag in ('')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_triger_UNKNOWN on ddl_command_start
+   when tag in ('???')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_ALTER_DATABASE on ddl_command_start
+   when tag in ('ALTER DATABASE')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_ALTER_EVENT_TRIGGER on ddl_command_start
+   when tag in ('ALTER EVENT TRIGGER')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_ALTER_ROLE on ddl_command_start
+   when tag in ('ALTER ROLE')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_ALTER_SYSTEM on ddl_command_start
+   when tag in ('ALTER SYSTEM')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_ALTER_TABLESPACE on ddl_command_start
+   when tag in ('ALTER TABLESPACE')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_ANALYZE on ddl_command_start
+   when tag in ('ANALYZE')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_BEGIN on ddl_command_start
+   when tag in ('BEGIN')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_CALL on ddl_command_start
+   when tag in ('CALL')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_CHECKPOINT on ddl_command_start
+   when tag in ('CHECKPOINT')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_CLOSE on ddl_command_start
+   when tag in ('CLOSE')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_CLOSE_CURSOR on ddl_command_start
+   when tag in ('CLOSE CURSOR')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_CLOSE_CURSOR_ALL on ddl_command_start
+   when tag in ('CLOSE CURSOR ALL')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_CLUSTER on ddl_command_start
+   when tag in ('CLUSTER')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_COMMIT on ddl_command_start
+   when tag in ('COMMIT')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_COMMIT_PREPARED on ddl_command_start
+   when tag in ('COMMIT PREPARED')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_COPY on ddl_command_start
+   when tag in ('COPY')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_COPY_FROM on ddl_command_start
+   when tag in ('COPY FROM')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_CREATE_DATABASE on ddl_command_start
+   when tag in ('CREATE DATABASE')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_CREATE_EVENT_TRIGGER on ddl_command_start
+   when tag in ('CREATE EVENT TRIGGER')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_CREATE_ROLE on ddl_command_start
+   when tag in ('CREATE ROLE')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_CREATE_TABLESPACE on ddl_command_start
+   when tag in ('CREATE TABLESPACE')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_DEALLOCATE on ddl_command_start
+   when tag in ('DEALLOCATE')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_DEALLOCATE_ALL on ddl_command_start
+   when tag in ('DEALLOCATE ALL')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_DECLARE_CURSOR on ddl_command_start
+   when tag in ('DECLARE CURSOR')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_DELETE on ddl_command_start
+   when tag in ('DELETE')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_DISCARD on ddl_command_start
+   when tag in ('DISCARD')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_DISCARD_ALL on ddl_command_start
+   when tag in ('DISCARD ALL')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_DISCARD_PLANS on ddl_command_start
+   when tag in ('DISCARD PLANS')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_DISCARD_SEQUENCES on ddl_command_start
+   when tag in ('DISCARD SEQUENCES')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_DISCARD_TEMP on ddl_command_start
+   when tag in ('DISCARD TEMP')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_DO on ddl_command_start
+   when tag in ('DO')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_DROP_DATABASE on ddl_command_start
+   when tag in ('DROP DATABASE')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_DROP_EVENT_TRIGGER on ddl_command_start
+   when tag in ('DROP EVENT TRIGGER')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_DROP_REPLICATION_SLOT on ddl_command_start
+   when tag in ('DROP REPLICATION SLOT')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_DROP_ROLE on ddl_command_start
+   when tag in ('DROP ROLE')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_DROP_TABLESPACE on ddl_command_start
+   when tag in ('DROP TABLESPACE')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_EXECUTE on ddl_command_start
+   when tag in ('EXECUTE')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_EXPLAIN on ddl_command_start
+   when tag in ('EXPLAIN')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_FETCH on ddl_command_start
+   when tag in ('FETCH')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_GRANT_ROLE on ddl_command_start
+   when tag in ('GRANT ROLE')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_INSERT on ddl_command_start
+   when tag in ('INSERT')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_LISTEN on ddl_command_start
+   when tag in ('LISTEN')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_LOAD on ddl_command_start
+   when tag in ('LOAD')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_LOCK_TABLE on ddl_command_start
+   when tag in ('LOCK TABLE')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_MOVE on ddl_command_start
+   when tag in ('MOVE')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_NOTIFY on ddl_command_start
+   when tag in ('NOTIFY')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_PREPARE on ddl_command_start
+   when tag in ('PREPARE')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_PREPARE_TRANSACTION on ddl_command_start
+   when tag in ('PREPARE TRANSACTION')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_REASSIGN_OWNED on ddl_command_start
+   when tag in ('REASSIGN OWNED')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_REINDEX on ddl_command_start
+   when tag in ('REINDEX')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_RELEASE on ddl_command_start
+   when tag in ('RELEASE')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_RESET on ddl_command_start
+   when tag in ('RESET')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_REVOKE on ddl_command_start
+   when tag in ('REVOKE')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_REVOKE_ROLE on ddl_command_start
+   when tag in ('REVOKE ROLE')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_ROLLBACK on ddl_command_start
+   when tag in ('ROLLBACK')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_ROLLBACK_PREPARED on ddl_command_start
+   when tag in ('ROLLBACK PREPARED')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_SAVEPOINT on ddl_command_start
+   when tag in ('SAVEPOINT')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_SECURITY_LABEL on ddl_command_start
+   when tag in ('SECURITY LABEL')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_SELECT on ddl_command_start
+   when tag in ('SELECT')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_SELECT_FOR_KEY_SHARE on ddl_command_start
+   when tag in ('SELECT FOR KEY SHARE')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_SELECT_FOR_NO_KEY_UPDATE on ddl_command_start
+   when tag in ('SELECT FOR NO KEY UPDATE')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_SELECT_FOR_SHARE on ddl_command_start
+   when tag in ('SELECT FOR SHARE')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_SELECT_FOR_UPDATE on ddl_command_start
+   when tag in ('SELECT FOR UPDATE')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_SET on ddl_command_start
+   when tag in ('SET')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_SET_CONSTRAINTS on ddl_command_start
+   when tag in ('SET CONSTRAINTS')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_SHOW on ddl_command_start
+   when tag in ('SHOW')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_START_TRANSACTION on ddl_command_start
+   when tag in ('START TRANSACTION')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_TRUNCATE_TABLE on ddl_command_start
+   when tag in ('TRUNCATE TABLE')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_UNLISTEN on ddl_command_start
+   when tag in ('UNLISTEN')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_UPDATE on ddl_command_start
+   when tag in ('UPDATE')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_VACUUM on ddl_command_start
+   when tag in ('VACUUM')
+   execute procedure test_event_trigger2();
+
+-- These are all ok
+create event trigger regress_event_trigger_ALTER_ACCESS_METHOD on ddl_command_start
+   when tag in ('ALTER ACCESS METHOD')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_ALTER_AGGREGATE on ddl_command_start
+   when tag in ('ALTER AGGREGATE')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_ALTER_CAST on ddl_command_start
+   when tag in ('ALTER CAST')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_ALTER_COLLATION on ddl_command_start
+   when tag in ('ALTER COLLATION')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_ALTER_CONSTRAINT on ddl_command_start
+   when tag in ('ALTER CONSTRAINT')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_ALTER_CONVERSION on ddl_command_start
+   when tag in ('ALTER CONVERSION')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_ALTER_DEFAULT_PRIVILEGES on ddl_command_start
+   when tag in ('ALTER DEFAULT PRIVILEGES')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_ALTER_DOMAIN on ddl_command_start
+   when tag in ('ALTER DOMAIN')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_ALTER_EXTENSION on ddl_command_start
+   when tag in ('ALTER EXTENSION')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_ALTER_FOREIGN_DATA_WRAPPER on ddl_command_start
+   when tag in ('ALTER FOREIGN DATA WRAPPER')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_ALTER_FOREIGN_TABLE on ddl_command_start
+   when tag in ('ALTER FOREIGN TABLE')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_ALTER_FUNCTION on ddl_command_start
+   when tag in ('ALTER FUNCTION')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_ALTER_INDEX on ddl_command_start
+   when tag in ('ALTER INDEX')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_ALTER_LANGUAGE on ddl_command_start
+   when tag in ('ALTER LANGUAGE')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_ALTER_LARGE_OBJECT on ddl_command_start
+   when tag in ('ALTER LARGE OBJECT')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_ALTER_MATERIALIZED_VIEW on ddl_command_start
+   when tag in ('ALTER MATERIALIZED VIEW')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_ALTER_OPERATOR on ddl_command_start
+   when tag in ('ALTER OPERATOR')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_ALTER_OPERATOR_CLASS on ddl_command_start
+   when tag in ('ALTER OPERATOR CLASS')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_ALTER_OPERATOR_FAMILY on ddl_command_start
+   when tag in ('ALTER OPERATOR FAMILY')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_ALTER_POLICY on ddl_command_start
+   when tag in ('ALTER POLICY')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_ALTER_PROCEDURE on ddl_command_start
+   when tag in ('ALTER PROCEDURE')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_ALTER_PUBLICATION on ddl_command_start
+   when tag in ('ALTER PUBLICATION')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_ALTER_ROUTINE on ddl_command_start
+   when tag in ('ALTER ROUTINE')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_ALTER_RULE on ddl_command_start
+   when tag in ('ALTER RULE')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_ALTER_SCHEMA on ddl_command_start
+   when tag in ('ALTER SCHEMA')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_ALTER_SEQUENCE on ddl_command_start
+   when tag in ('ALTER SEQUENCE')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_ALTER_SERVER on ddl_command_start
+   when tag in ('ALTER SERVER')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_ALTER_STATISTICS on ddl_command_start
+   when tag in ('ALTER STATISTICS')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_ALTER_SUBSCRIPTION on ddl_command_start
+   when tag in ('ALTER SUBSCRIPTION')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_ALTER_TABLE on ddl_command_start
+   when tag in ('ALTER TABLE')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_ALTER_TEXT_SEARCH_CONFIGURATION on ddl_command_start
+   when tag in ('ALTER TEXT SEARCH CONFIGURATION')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_ALTER_TEXT_SEARCH_DICTIONARY on ddl_command_start
+   when tag in ('ALTER TEXT SEARCH DICTIONARY')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_ALTER_TEXT_SEARCH_PARSER on ddl_command_start
+   when tag in ('ALTER TEXT SEARCH PARSER')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_ALTER_TEXT_SEARCH_TEMPLATE on ddl_command_start
+   when tag in ('ALTER TEXT SEARCH TEMPLATE')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_ALTER_TRANSFORM on ddl_command_start
+   when tag in ('ALTER TRANSFORM')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_ALTER_TRIGGER on ddl_command_start
+   when tag in ('ALTER TRIGGER')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_ALTER_TYPE on ddl_command_start
+   when tag in ('ALTER TYPE')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_ALTER_USER_MAPPING on ddl_command_start
+   when tag in ('ALTER USER MAPPING')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_ALTER_VIEW on ddl_command_start
+   when tag in ('ALTER VIEW')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_COMMENT on ddl_command_start
+   when tag in ('COMMENT')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_CREATE_ACCESS_METHOD on ddl_command_start
+   when tag in ('CREATE ACCESS METHOD')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_CREATE_AGGREGATE on ddl_command_start
+   when tag in ('CREATE AGGREGATE')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_CREATE_CAST on ddl_command_start
+   when tag in ('CREATE CAST')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_CREATE_COLLATION on ddl_command_start
+   when tag in ('CREATE COLLATION')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_CREATE_CONSTRAINT on ddl_command_start
+   when tag in ('CREATE CONSTRAINT')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_CREATE_CONVERSION on ddl_command_start
+   when tag in ('CREATE CONVERSION')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_CREATE_DOMAIN on ddl_command_start
+   when tag in ('CREATE DOMAIN')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_CREATE_EXTENSION on ddl_command_start
+   when tag in ('CREATE EXTENSION')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_CREATE_FOREIGN_DATA_WRAPPER on ddl_command_start
+   when tag in ('CREATE FOREIGN DATA WRAPPER')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_CREATE_FOREIGN_TABLE on ddl_command_start
+   when tag in ('CREATE FOREIGN TABLE')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_CREATE_FUNCTION on ddl_command_start
+   when tag in ('CREATE FUNCTION')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_CREATE_INDEX on ddl_command_start
+   when tag in ('CREATE INDEX')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_CREATE_LANGUAGE on ddl_command_start
+   when tag in ('CREATE LANGUAGE')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_CREATE_MATERIALIZED_VIEW on ddl_command_start
+   when tag in ('CREATE MATERIALIZED VIEW')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_CREATE_OPERATOR on ddl_command_start
+   when tag in ('CREATE OPERATOR')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_CREATE_OPERATOR_CLASS on ddl_command_start
+   when tag in ('CREATE OPERATOR CLASS')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_CREATE_OPERATOR_FAMILY on ddl_command_start
+   when tag in ('CREATE OPERATOR FAMILY')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_CREATE_POLICY on ddl_command_start
+   when tag in ('CREATE POLICY')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_CREATE_PROCEDURE on ddl_command_start
+   when tag in ('CREATE PROCEDURE')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_CREATE_PUBLICATION on ddl_command_start
+   when tag in ('CREATE PUBLICATION')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_CREATE_ROUTINE on ddl_command_start
+   when tag in ('CREATE ROUTINE')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_CREATE_RULE on ddl_command_start
+   when tag in ('CREATE RULE')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_CREATE_SCHEMA on ddl_command_start
+   when tag in ('CREATE SCHEMA')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_CREATE_SEQUENCE on ddl_command_start
+   when tag in ('CREATE SEQUENCE')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_CREATE_SERVER on ddl_command_start
+   when tag in ('CREATE SERVER')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_CREATE_STATISTICS on ddl_command_start
+   when tag in ('CREATE STATISTICS')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_CREATE_SUBSCRIPTION on ddl_command_start
+   when tag in ('CREATE SUBSCRIPTION')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_CREATE_TABLE on ddl_command_start
+   when tag in ('CREATE TABLE')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_CREATE_TABLE_AS on ddl_command_start
+   when tag in ('CREATE TABLE AS')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_CREATE_TEXT_SEARCH_CONFIGURATION on ddl_command_start
+   when tag in ('CREATE TEXT SEARCH CONFIGURATION')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_CREATE_TEXT_SEARCH_DICTIONARY on ddl_command_start
+   when tag in ('CREATE TEXT SEARCH DICTIONARY')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_CREATE_TEXT_SEARCH_PARSER on ddl_command_start
+   when tag in ('CREATE TEXT SEARCH PARSER')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_CREATE_TEXT_SEARCH_TEMPLATE on ddl_command_start
+   when tag in ('CREATE TEXT SEARCH TEMPLATE')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_CREATE_TRANSFORM on ddl_command_start
+   when tag in ('CREATE TRANSFORM')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_CREATE_TRIGGER on ddl_command_start
+   when tag in ('CREATE TRIGGER')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_CREATE_TYPE on ddl_command_start
+   when tag in ('CREATE TYPE')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_CREATE_USER_MAPPING on ddl_command_start
+   when tag in ('CREATE USER MAPPING')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_CREATE_VIEW on ddl_command_start
+   when tag in ('CREATE VIEW')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_DROP_ACCESS_METHOD on ddl_command_start
+   when tag in ('DROP ACCESS METHOD')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_DROP_AGGREGATE on ddl_command_start
+   when tag in ('DROP AGGREGATE')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_DROP_CAST on ddl_command_start
+   when tag in ('DROP CAST')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_DROP_COLLATION on ddl_command_start
+   when tag in ('DROP COLLATION')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_DROP_CONSTRAINT on ddl_command_start
+   when tag in ('DROP CONSTRAINT')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_DROP_CONVERSION on ddl_command_start
+   when tag in ('DROP CONVERSION')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_DROP_DOMAIN on ddl_command_start
+   when tag in ('DROP DOMAIN')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_DROP_EXTENSION on ddl_command_start
+   when tag in ('DROP EXTENSION')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_DROP_FOREIGN_DATA_WRAPPER on ddl_command_start
+   when tag in ('DROP FOREIGN DATA WRAPPER')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_DROP_FOREIGN_TABLE on ddl_command_start
+   when tag in ('DROP FOREIGN TABLE')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_DROP_FUNCTION on ddl_command_start
+   when tag in ('DROP FUNCTION')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_DROP_INDEX on ddl_command_start
+   when tag in ('DROP INDEX')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_DROP_LANGUAGE on ddl_command_start
+   when tag in ('DROP LANGUAGE')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_DROP_MATERIALIZED_VIEW on ddl_command_start
+   when tag in ('DROP MATERIALIZED VIEW')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_DROP_OPERATOR on ddl_command_start
+   when tag in ('DROP OPERATOR')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_DROP_OPERATOR_CLASS on ddl_command_start
+   when tag in ('DROP OPERATOR CLASS')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_DROP_OPERATOR_FAMILY on ddl_command_start
+   when tag in ('DROP OPERATOR FAMILY')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_DROP_OWNED on ddl_command_start
+   when tag in ('DROP OWNED')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_DROP_POLICY on ddl_command_start
+   when tag in ('DROP POLICY')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_DROP_PROCEDURE on ddl_command_start
+   when tag in ('DROP PROCEDURE')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_DROP_PUBLICATION on ddl_command_start
+   when tag in ('DROP PUBLICATION')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_DROP_ROUTINE on ddl_command_start
+   when tag in ('DROP ROUTINE')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_DROP_RULE on ddl_command_start
+   when tag in ('DROP RULE')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_DROP_SCHEMA on ddl_command_start
+   when tag in ('DROP SCHEMA')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_DROP_SEQUENCE on ddl_command_start
+   when tag in ('DROP SEQUENCE')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_DROP_SERVER on ddl_command_start
+   when tag in ('DROP SERVER')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_DROP_STATISTICS on ddl_command_start
+   when tag in ('DROP STATISTICS')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_DROP_SUBSCRIPTION on ddl_command_start
+   when tag in ('DROP SUBSCRIPTION')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_DROP_TABLE on ddl_command_start
+   when tag in ('DROP TABLE')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_DROP_TEXT_SEARCH_CONFIGURATION on ddl_command_start
+   when tag in ('DROP TEXT SEARCH CONFIGURATION')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_DROP_TEXT_SEARCH_DICTIONARY on ddl_command_start
+   when tag in ('DROP TEXT SEARCH DICTIONARY')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_DROP_TEXT_SEARCH_PARSER on ddl_command_start
+   when tag in ('DROP TEXT SEARCH PARSER')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_DROP_TEXT_SEARCH_TEMPLATE on ddl_command_start
+   when tag in ('DROP TEXT SEARCH TEMPLATE')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_DROP_TRANSFORM on ddl_command_start
+   when tag in ('DROP TRANSFORM')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_DROP_TRIGGER on ddl_command_start
+   when tag in ('DROP TRIGGER')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_DROP_TYPE on ddl_command_start
+   when tag in ('DROP TYPE')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_DROP_USER_MAPPING on ddl_command_start
+   when tag in ('DROP USER MAPPING')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_DROP_VIEW on ddl_command_start
+   when tag in ('DROP VIEW')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_GRANT on ddl_command_start
+   when tag in ('GRANT')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_IMPORT_FOREIGN_SCHEMA on ddl_command_start
+   when tag in ('IMPORT FOREIGN SCHEMA')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_REFRESH_MATERIALIZED_VIEW on ddl_command_start
+   when tag in ('REFRESH MATERIALIZED VIEW')
+   execute procedure test_event_trigger2();
+
+create event trigger regress_event_trigger_SELECT_INTO on ddl_command_start
+   when tag in ('SELECT INTO')
+   execute procedure test_event_trigger2();
+
+-- drop should cascade to the event trigger
+drop function test_event_trigger2() cascade;
+
 -- drop as non-superuser should fail
 create role regress_evt_user;
 set role regress_evt_user;
-- 
2.21.1 (Apple Git-122.3)

