summaryrefslogtreecommitdiff
path: root/src/include/commands/event_trigger.h
diff options
context:
space:
mode:
authorSimon Riggs <simon@2ndQuadrant.com>2014-12-08 00:55:28 +0900
committerSimon Riggs <simon@2ndQuadrant.com>2014-12-08 00:55:28 +0900
commit618c9430a82860c84a3be2711eec2c3b43573b2a (patch)
treee8415e009b1cfd89a73d6211271f5d6d414bfba5 /src/include/commands/event_trigger.h
parentb8e33a85d4e86a8391118c3d5cdb249b560dec4f (diff)
Event Trigger for table_rewrite
Generate a table_rewrite event when ALTER TABLE attempts to rewrite a table. Provide helper functions to identify table and reason. Intended use case is to help assess or to react to schema changes that might hold exclusive locks for long periods. Dimitri Fontaine, triggering an edit by Simon Riggs Reviewed in detail by Michael Paquier
Diffstat (limited to 'src/include/commands/event_trigger.h')
-rw-r--r--src/include/commands/event_trigger.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/include/commands/event_trigger.h b/src/include/commands/event_trigger.h
index 0233f4c4832..bcd656b72dd 100644
--- a/src/include/commands/event_trigger.h
+++ b/src/include/commands/event_trigger.h
@@ -26,6 +26,11 @@ typedef struct EventTriggerData
const char *tag; /* command tag */
} EventTriggerData;
+#define AT_REWRITE_ALTER_PERSISTENCE 0x01
+#define AT_REWRITE_DEFAULT_VAL 0x02
+#define AT_REWRITE_COLUMN_REWRITE 0x04
+#define AT_REWRITE_ALTER_OID 0x08
+
/*
* EventTriggerData is the node type that is passed as fmgr "context" info
* when a function is called by the event trigger manager.
@@ -46,6 +51,7 @@ extern bool EventTriggerSupportsObjectClass(ObjectClass objclass);
extern void EventTriggerDDLCommandStart(Node *parsetree);
extern void EventTriggerDDLCommandEnd(Node *parsetree);
extern void EventTriggerSQLDrop(Node *parsetree);
+extern void EventTriggerTableRewrite(Node *parsetree, Oid tableOid, int reason);
extern bool EventTriggerBeginCompleteQuery(void);
extern void EventTriggerEndCompleteQuery(void);