Re: Use of systable_beginscan_ordered in event trigger patch

From: Dimitri Fontaine <dimitri(at)2ndQuadrant(dot)fr>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Use of systable_beginscan_ordered in event trigger patch
Date: 2012-12-12 14:08:14
Message-ID: m21uevcqi9.fsf@2ndQuadrant.fr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)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
RAISE EXCEPTION '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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Erik Rijkers 2012-12-12 14:44:35 Re: [v9.3] writable foreign tables
Previous Message Kohei KaiGai 2012-12-12 13:45:04 Re: [v9.3] writable foreign tables