Header And Logo

PostgreSQL
| The world's most advanced open source database.

event_trigger.h

Go to the documentation of this file.
00001 /*-------------------------------------------------------------------------
00002  *
00003  * event_trigger.h
00004  *    Declarations for command trigger handling.
00005  *
00006  * Portions Copyright (c) 1996-2013, PostgreSQL Global Development Group
00007  * Portions Copyright (c) 1994, Regents of the University of California
00008  *
00009  * src/include/commands/event_trigger.h
00010  *
00011  *-------------------------------------------------------------------------
00012  */
00013 #ifndef EVENT_TRIGGER_H
00014 #define EVENT_TRIGGER_H
00015 
00016 #include "catalog/dependency.h"
00017 #include "catalog/objectaddress.h"
00018 #include "catalog/pg_event_trigger.h"
00019 #include "nodes/parsenodes.h"
00020 
00021 typedef struct EventTriggerData
00022 {
00023     NodeTag     type;
00024     const char *event;              /* event name */
00025     Node       *parsetree;          /* parse tree */
00026     const char *tag;                /* command tag */
00027 } EventTriggerData;
00028 
00029 /*
00030  * EventTriggerData is the node type that is passed as fmgr "context" info
00031  * when a function is called by the event trigger manager.
00032  */
00033 #define CALLED_AS_EVENT_TRIGGER(fcinfo) \
00034     ((fcinfo)->context != NULL && IsA((fcinfo)->context, EventTriggerData))
00035 
00036 extern Oid CreateEventTrigger(CreateEventTrigStmt *stmt);
00037 extern void RemoveEventTriggerById(Oid ctrigOid);
00038 extern Oid  get_event_trigger_oid(const char *trigname, bool missing_ok);
00039 
00040 extern Oid AlterEventTrigger(AlterEventTrigStmt *stmt);
00041 extern Oid AlterEventTriggerOwner(const char *name, Oid newOwnerId);
00042 extern void AlterEventTriggerOwner_oid(Oid, Oid newOwnerId);
00043 
00044 extern bool EventTriggerSupportsObjectType(ObjectType obtype);
00045 extern bool EventTriggerSupportsObjectClass(ObjectClass objclass);
00046 extern void EventTriggerDDLCommandStart(Node *parsetree);
00047 extern void EventTriggerDDLCommandEnd(Node *parsetree);
00048 extern void EventTriggerSQLDrop(Node *parsetree);
00049 
00050 extern bool EventTriggerBeginCompleteQuery(void);
00051 extern void EventTriggerEndCompleteQuery(void);
00052 extern bool trackDroppedObjectsNeeded(void);
00053 extern void EventTriggerSQLDropAddObject(ObjectAddress *object);
00054 
00055 #endif   /* EVENT_TRIGGER_H */