summaryrefslogtreecommitdiff
path: root/src/include/commands
diff options
context:
space:
mode:
authorVadim B. Mikheev <vadim4o@yahoo.com>1997-09-01 08:10:12 +0000
committerVadim B. Mikheev <vadim4o@yahoo.com>1997-09-01 08:10:12 +0000
commit2ca45d572952a6a6ea29fc039426c57bb6ebfe3f (patch)
tree4f8f39db74e51a09900d13a61d55e9cbbfe59364 /src/include/commands
parent38f0ffd36c6298b018de21aa623e3532df7846d8 (diff)
downloadpostgresql-2ca45d572952a6a6ea29fc039426c57bb6ebfe3f.tar.gz
Function prototypes.
Diffstat (limited to 'src/include/commands')
-rw-r--r--src/include/commands/trigger.h38
1 files changed, 38 insertions, 0 deletions
diff --git a/src/include/commands/trigger.h b/src/include/commands/trigger.h
index a9d1c73679..e603a3f8dc 100644
--- a/src/include/commands/trigger.h
+++ b/src/include/commands/trigger.h
@@ -9,7 +9,45 @@
#ifndef TRIGGER_H
#define TRIGGER_H
+#include "access/tupdesc.h"
+#include "access/htup.h"
+#include "utils/rel.h"
+
+typedef uint32 TriggerAction;
+
+#define TRIGGER_ACTION_INSERT 0x00000000
+#define TRIGGER_ACTION_DELETE 0x00000001
+#define TRIGGER_ACTION_UPDATE 0x00000010
+#define TRIGGER_ACTION_OPMASK 0x00000011
+#define TRIGGER_ACTION_ROW 4
+
+#define TRIGGER_FIRED_BY_INSERT (action) \
+ (((TriggerAction) action & TRIGGER_ACTION_OPMASK) == \
+ TRIGGER_ACTION_INSERT)
+
+#define TRIGGER_FIRED_BY_DELETE (action) \
+ (((TriggerAction) action & TRIGGER_ACTION_OPMASK) == \
+ TRIGGER_ACTION_DELETE)
+
+#define TRIGGER_FIRED_BY_UPDATE (action) \
+ (((TriggerAction) action & TRIGGER_ACTION_OPMASK) == \
+ TRIGGER_ACTION_UPDATE)
+
+#define TRIGGER_FIRED_FOR_ROW (action) \
+ ((TriggerAction) action & TRIGGER_ACTION_ROW)
+
+#define TRIGGER_FIRED_FOR_STATEMENT (action) \
+ (!TRIGGER_FIRED_FOR_ROW (action))
+
+
extern void CreateTrigger (CreateTrigStmt *stmt);
extern void DropTrigger (DropTrigStmt *stmt);
+extern HeapTuple ExecBRInsertTriggers (Relation rel, HeapTuple tuple);
+extern void ExecARInsertTriggers (Relation rel, HeapTuple tuple);
+extern bool ExecBRDeleteTriggers (Relation rel, ItemPointer tupleid);
+extern void ExecARDeleteTriggers (Relation rel, ItemPointer tupleid);
+extern HeapTuple ExecBRUpdateTriggers (Relation rel, ItemPointer tupleid, HeapTuple tuple);
+extern void ExecARUpdateTriggers (Relation rel, ItemPointer tupleid, HeapTuple tuple);
+
#endif /* TRIGGER_H */