mirror of
https://github.com/postgres/postgres.git
synced 2025-10-24 01:29:19 +03:00
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
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user