mirror of
https://github.com/postgres/postgres.git
synced 2025-09-02 04:21:28 +03:00
Syntax support and documentation for event triggers.
They don't actually do anything yet; that will get fixed in a follow-on commit. But this gets the basic infrastructure in place, including CREATE/ALTER/DROP EVENT TRIGGER; support for COMMENT, SECURITY LABEL, and ALTER EXTENSION .. ADD/DROP EVENT TRIGGER; pg_dump and psql support; and documentation for the anticipated initial feature set. Dimitri Fontaine, with review and a bunch of additional hacking by me. Thom Brown extensively reviewed earlier versions of this patch set, but there's not a whole lot of that code left in this commit, as it turns out.
This commit is contained in:
@@ -33,6 +33,7 @@
|
||||
#include "commands/dbcommands.h"
|
||||
#include "commands/defrem.h"
|
||||
#include "commands/discard.h"
|
||||
#include "commands/event_trigger.h"
|
||||
#include "commands/explain.h"
|
||||
#include "commands/extension.h"
|
||||
#include "commands/lockcmds.h"
|
||||
@@ -183,6 +184,8 @@ check_xact_readonly(Node *parsetree)
|
||||
case T_CommentStmt:
|
||||
case T_DefineStmt:
|
||||
case T_CreateCastStmt:
|
||||
case T_CreateEventTrigStmt:
|
||||
case T_AlterEventTrigStmt:
|
||||
case T_CreateConversionStmt:
|
||||
case T_CreatedbStmt:
|
||||
case T_CreateDomainStmt:
|
||||
@@ -1056,6 +1059,14 @@ standard_ProcessUtility(Node *parsetree,
|
||||
InvalidOid, InvalidOid, false);
|
||||
break;
|
||||
|
||||
case T_CreateEventTrigStmt:
|
||||
CreateEventTrigger((CreateEventTrigStmt *) parsetree);
|
||||
break;
|
||||
|
||||
case T_AlterEventTrigStmt:
|
||||
AlterEventTrigger((AlterEventTrigStmt *) parsetree);
|
||||
break;
|
||||
|
||||
case T_CreatePLangStmt:
|
||||
CreateProceduralLanguage((CreatePLangStmt *) parsetree);
|
||||
break;
|
||||
@@ -1472,6 +1483,9 @@ AlterObjectTypeCommandTag(ObjectType objtype)
|
||||
case OBJECT_TRIGGER:
|
||||
tag = "ALTER TRIGGER";
|
||||
break;
|
||||
case OBJECT_EVENT_TRIGGER:
|
||||
tag = "ALTER EVENT TRIGGER";
|
||||
break;
|
||||
case OBJECT_TSCONFIGURATION:
|
||||
tag = "ALTER TEXT SEARCH CONFIGURATION";
|
||||
break;
|
||||
@@ -1741,6 +1755,9 @@ CreateCommandTag(Node *parsetree)
|
||||
case OBJECT_TRIGGER:
|
||||
tag = "DROP TRIGGER";
|
||||
break;
|
||||
case OBJECT_EVENT_TRIGGER:
|
||||
tag = "DROP EVENT TRIGGER";
|
||||
break;
|
||||
case OBJECT_RULE:
|
||||
tag = "DROP RULE";
|
||||
break;
|
||||
@@ -1994,6 +2011,14 @@ CreateCommandTag(Node *parsetree)
|
||||
tag = "CREATE TRIGGER";
|
||||
break;
|
||||
|
||||
case T_CreateEventTrigStmt:
|
||||
tag = "CREATE EVENT TRIGGER";
|
||||
break;
|
||||
|
||||
case T_AlterEventTrigStmt:
|
||||
tag = "ALTER EVENT TRIGGER";
|
||||
break;
|
||||
|
||||
case T_CreatePLangStmt:
|
||||
tag = "CREATE LANGUAGE";
|
||||
break;
|
||||
@@ -2489,6 +2514,14 @@ GetCommandLogLevel(Node *parsetree)
|
||||
lev = LOGSTMT_DDL;
|
||||
break;
|
||||
|
||||
case T_CreateEventTrigStmt:
|
||||
lev = LOGSTMT_DDL;
|
||||
break;
|
||||
|
||||
case T_AlterEventTrigStmt:
|
||||
lev = LOGSTMT_DDL;
|
||||
break;
|
||||
|
||||
case T_CreatePLangStmt:
|
||||
lev = LOGSTMT_DDL;
|
||||
break;
|
||||
|
Reference in New Issue
Block a user