00001 /*------------------------------------------------------------------------- 00002 * 00003 * reltrigger.h 00004 * POSTGRES relation trigger definitions. 00005 * 00006 * 00007 * Portions Copyright (c) 1996-2013, PostgreSQL Global Development Group 00008 * Portions Copyright (c) 1994, Regents of the University of California 00009 * 00010 * src/include/utils/reltrigger.h 00011 * 00012 *------------------------------------------------------------------------- 00013 */ 00014 #ifndef RELTRIGGER_H 00015 #define RELTRIGGER_H 00016 00017 00018 /* 00019 * These struct really belongs to trigger.h, but we put it separately so that 00020 * it can be cleanly included in rel.h and other places. 00021 */ 00022 00023 typedef struct Trigger 00024 { 00025 Oid tgoid; /* OID of trigger (pg_trigger row) */ 00026 /* Remaining fields are copied from pg_trigger, see pg_trigger.h */ 00027 char *tgname; 00028 Oid tgfoid; 00029 int16 tgtype; 00030 char tgenabled; 00031 bool tgisinternal; 00032 Oid tgconstrrelid; 00033 Oid tgconstrindid; 00034 Oid tgconstraint; 00035 bool tgdeferrable; 00036 bool tginitdeferred; 00037 int16 tgnargs; 00038 int16 tgnattr; 00039 int16 *tgattr; 00040 char **tgargs; 00041 char *tgqual; 00042 } Trigger; 00043 00044 typedef struct TriggerDesc 00045 { 00046 Trigger *triggers; /* array of Trigger structs */ 00047 int numtriggers; /* number of array entries */ 00048 00049 /* 00050 * These flags indicate whether the array contains at least one of each 00051 * type of trigger. We use these to skip searching the array if not. 00052 */ 00053 bool trig_insert_before_row; 00054 bool trig_insert_after_row; 00055 bool trig_insert_instead_row; 00056 bool trig_insert_before_statement; 00057 bool trig_insert_after_statement; 00058 bool trig_update_before_row; 00059 bool trig_update_after_row; 00060 bool trig_update_instead_row; 00061 bool trig_update_before_statement; 00062 bool trig_update_after_statement; 00063 bool trig_delete_before_row; 00064 bool trig_delete_after_row; 00065 bool trig_delete_instead_row; 00066 bool trig_delete_before_statement; 00067 bool trig_delete_after_statement; 00068 /* there are no row-level truncate triggers */ 00069 bool trig_truncate_before_statement; 00070 bool trig_truncate_after_statement; 00071 } TriggerDesc; 00072 00073 00074 #endif /* RELTRIGGER_H */