gooderp18绿色标准版
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

81 line
2.2KB

  1. /*-------------------------------------------------------------------------
  2. *
  3. * reltrigger.h
  4. * POSTGRES relation trigger definitions.
  5. *
  6. *
  7. * Portions Copyright (c) 1996-2019, PostgreSQL Global Development Group
  8. * Portions Copyright (c) 1994, Regents of the University of California
  9. *
  10. * src/include/utils/reltrigger.h
  11. *
  12. *-------------------------------------------------------------------------
  13. */
  14. #ifndef RELTRIGGER_H
  15. #define RELTRIGGER_H
  16. /*
  17. * These struct really belongs to trigger.h, but we put it separately so that
  18. * it can be cleanly included in rel.h and other places.
  19. */
  20. typedef struct Trigger
  21. {
  22. Oid tgoid; /* OID of trigger (pg_trigger row) */
  23. /* Remaining fields are copied from pg_trigger, see pg_trigger.h */
  24. char *tgname;
  25. Oid tgfoid;
  26. int16 tgtype;
  27. char tgenabled;
  28. bool tgisinternal;
  29. Oid tgconstrrelid;
  30. Oid tgconstrindid;
  31. Oid tgconstraint;
  32. bool tgdeferrable;
  33. bool tginitdeferred;
  34. int16 tgnargs;
  35. int16 tgnattr;
  36. int16 *tgattr;
  37. char **tgargs;
  38. char *tgqual;
  39. char *tgoldtable;
  40. char *tgnewtable;
  41. } Trigger;
  42. typedef struct TriggerDesc
  43. {
  44. Trigger *triggers; /* array of Trigger structs */
  45. int numtriggers; /* number of array entries */
  46. /*
  47. * These flags indicate whether the array contains at least one of each
  48. * type of trigger. We use these to skip searching the array if not.
  49. */
  50. bool trig_insert_before_row;
  51. bool trig_insert_after_row;
  52. bool trig_insert_instead_row;
  53. bool trig_insert_before_statement;
  54. bool trig_insert_after_statement;
  55. bool trig_update_before_row;
  56. bool trig_update_after_row;
  57. bool trig_update_instead_row;
  58. bool trig_update_before_statement;
  59. bool trig_update_after_statement;
  60. bool trig_delete_before_row;
  61. bool trig_delete_after_row;
  62. bool trig_delete_instead_row;
  63. bool trig_delete_before_statement;
  64. bool trig_delete_after_statement;
  65. /* there are no row-level truncate triggers */
  66. bool trig_truncate_before_statement;
  67. bool trig_truncate_after_statement;
  68. /* Is there at least one trigger specifying each transition relation? */
  69. bool trig_insert_new_table;
  70. bool trig_update_old_table;
  71. bool trig_update_new_table;
  72. bool trig_delete_old_table;
  73. } TriggerDesc;
  74. #endif /* RELTRIGGER_H */
上海开阖软件有限公司 沪ICP备12045867号-1