D.32. RDB$TRIGGERS
RDB$TRIGGERS
stores the trigger definitions for all tables and views.
Column Name | Data Type | Description |
---|---|---|
|
| Trigger name |
|
| The name of the table or view the trigger applies to.
NULL if the trigger is applicable to a database event ( |
|
| Position of this trigger in the sequence. Zero usually means that no sequence position is specified |
|
| The event the trigger fires on, see Section D.32.1, “ |
|
| Stores the source code of the trigger in PSQL |
|
| Stores the trigger in the binary language representation (BLR) |
|
| Trigger comment text |
|
| Indicates whether the trigger is currently inactive (1) or active (0) |
|
| Flag: indicates whether the trigger is user-defined (value 0) or system-defined (value 1 or greater) |
|
| Internal use |
|
| Indicates whether the text of the trigger remains valid after the latest modification by the the |
|
| Contains debugging information about variables used in the trigger |
|
| Engine for external triggers.
|
|
| The exported name of the external trigger in the trigger library.
Note, this is often not the same as |
D.32.1. RDB$TRIGGER_TYPE
Value
The value of RDB$TRIGGER_TYPE
is built from:
|
before insert |
|
after insert |
|
before update |
|
after update |
|
before delete |
|
after delete |
|
before insert or update |
|
after insert or update |
|
before insert or delete |
|
after insert or delete |
|
before update or delete |
|
after update or delete |
|
before insert or update or delete |
|
after insert or update or delete |
|
on connect |
|
on disconnect |
|
on transaction start |
|
on transaction commit |
|
on transaction rollback |
Identification of the exact RDB$TRIGGER_TYPE
code is a little more complicated, since it is a bitmap, calculated according to which phase and events are covered and the order in which they are defined.
For the curious, the calculation is explained in this code comment by Mark Rotteveel.
For DDL triggers, the trigger type is obtained by bitwise OR above the event phase (0
— BEFORE, 1
— AFTER) and all listed types events:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
For example a trigger with
BEFORE CREATE PROCEDURE OR CREATE FUNCTION
will be of type 0x0000000000004090
,
AFTER CREATE PROCEDURE OR CREATE FUNCTION
— 0x0000000000004091
,
BEFORE DROP FUNCTION OR DROP EXCEPTION
— 0x00000000000044200
,
AFTER DROP FUNCTION OR DROP EXCEPTION
— 0x00000000000044201
,
BEFORE DROP TRIGGER OR DROP DOMAIN
— 0x00000000001005000
,
AFTER DROP TRIGGER OR DROP DOMAIN
— 0x00000000001005001
.