Re: Use of systable_beginscan_ordered in event trigger patch - Mailing list pgsql-hackers

From Dimitri Fontaine
Subject Re: Use of systable_beginscan_ordered in event trigger patch
Date
Msg-id m21uevcqi9.fsf@2ndQuadrant.fr
Whole thread Raw
In response to Re: Use of systable_beginscan_ordered in event trigger patch  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Use of systable_beginscan_ordered in event trigger patch
List pgsql-hackers
Tom Lane <tgl@sss.pgh.pa.us> writes:
> Yeah, I had forgotten about that loose end, but we definitely need
> something of the sort.  Committed with additional documentation.
> (I put something in the CREATE EVENT TRIGGER ref page, but do we
> need anything about it in chapter 37?)

Thanks!

I guess we could add a note at the end of the "Overview of Event Trigger
Behavior" section. Then maybe we should explain in that section that you
can't set an event trigger to fire on event trigger commands.

> BTW, is the example in the CREATE EVENT TRIGGER ref page meant as an
> IQ test for unwary readers?  You do know there are people who will
> copy-and-paste just about any example that's put in front of them.
> Perhaps we just want to make sure they internalize the advice about how
> to get out of a broken-event-trigger situation.

For those following at home, the example is:
   CREATE OR REPLACE FUNCTION abort_any_command()     RETURNS event_trigger    LANGUAGE plpgsql     AS $$   BEGIN
RAISEEXCEPTION 'command % is disabled', tg_tag;   END;   $$;      CREATE EVENT TRIGGER abort_ddl ON ddl_command_start
  EXECUTE PROCEDURE abort_any_command();
 

Maybe we could just append to it how to remove such an event trigger,
which is easy to do because you can't target an event trigger related
command with event triggers, so the following is not disabled:
   DROP EVENT TRIGGER abort_ddl;

Regards,
-- 
Dimitri Fontaine
http://2ndQuadrant.fr     PostgreSQL : Expertise, Formation et Support



pgsql-hackers by date:

Previous
From: Kohei KaiGai
Date:
Subject: Re: [v9.3] writable foreign tables
Next
From: "Erik Rijkers"
Date:
Subject: Re: [v9.3] writable foreign tables