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 PostgreSQL 9.3 onwards.

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

An event trigger

static EventTrigger.from_map(name, inobj)

Initialize an event trigger instance from a YAML map

Parameters:
  • name – trigger name
  • inobj – YAML map of the event trigger
Returns:

event trigger instance

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
Returns:dictionary
EventTrigger.create(obj, *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

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