Robert Haas <robertmhaas@gmail.com> writes:
> Can you point me specifically at what you have in mind so I can make
> sure I'm considering the right thing?
Something like this part:
+ -- now try something crazy to ensure we don't crash the backend
+ create function test_event_trigger_drop_function()
+ returns event_trigger
+ as $$
+ BEGIN
+ drop function test_event_trigger2() cascade;
+ END
+ $$ language plpgsql;
+
+ create function test_event_trigger2() returns event_trigger as $$
+ BEGIN
+ RAISE NOTICE 'test_event_trigger2: % %', tg_event, tg_tag;
+ END
+ $$ language plpgsql;
+
+ create event trigger drop_test_a on "ddl_command_start"
+ when tag in ('create table')
+ execute procedure test_event_trigger_drop_function();
+
+ create event trigger drop_test_b on "ddl_command_start"
+ execute procedure test_event_trigger2();
+
+ create table event_trigger_fire1 (a int);
+
+ -- then cleanup the crazy test
+ drop event trigger drop_test_a;
+ drop event trigger drop_test_b;
+ drop function test_event_trigger_drop_function();
The only problem for the regression tests being that there's an OID in
the ouput, but with your proposed error message that would go away.
--
Dimitri Fontaine
http://2ndQuadrant.fr PostgreSQL : Expertise, Formation et Support