Виктор
Виктор

Reputation: 57

how can I update the event trigger?

I create event trigger:

CREATE EVENT TRIGGER tr_event_begin ON ddl_command_start EXECUTE PROCEDURE event_trigger_begin();

later I need to change the event or procedure. Now, I have to do so:

DROP EVENT TRIGGER tr_event_begin;
CREATE EVENT TRIGGER tr_event_begin ON ddl_command_end EXECUTE PROCEDURE myProc();

how to do it differently? Without removing the trigger, update it... sql only.

Upvotes: 3

Views: 69

Answers (1)

Alberto Blanco Cala
Alberto Blanco Cala

Reputation: 88

I think your proposal is the most elegant way to do it. https://www.postgresql.org/docs/current/static/sql-altereventtrigger.html

Upvotes: 1

Related Questions