Event Triggers

The eventtrig module defines two classes, EventTrigger and EventTriggerDict, derived from DbObject and DbObjectDict, respectively.

Event Trigger

EventTrigger is derived from DbObject and represents an event trigger available from Postgres 9.3 onwards.

class pyrseas.dbobject.eventtrig.EventTrigger(name, description, owner, event, procedure, enabled=False, tags=None, oid=None)

An event trigger

EventTrigger.to_map(db, no_owner=False, no_privs=False)

Convert an event trigger definition to a YAML-suitable format

Parameters:db – db used to tie the objects together
EventTrigger.create(*args, **kwargs)

Return SQL statements to CREATE the event trigger

Returns:SQL statements

Event Trigger Dictionary

EventTriggerDict is derived from DbObjectDict. It is a dictionary that represents the collection of event triggers in a database.

class pyrseas.dbobject.eventtrig.EventTriggerDict(dbconn=None)

The collection of event triggers in a database

EventTriggerDict.from_map(intriggers, newdb)

Initalize the dictionary of triggers by converting the input map

  • intriggers – YAML map defining the event triggers
  • newdb – dictionary of input database