mirror of
https://github.com/postgres/postgres.git
synced 2025-07-12 21:01:52 +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:
@ -3466,6 +3466,30 @@ _copyCreateTrigStmt(const CreateTrigStmt *from)
|
||||
return newnode;
|
||||
}
|
||||
|
||||
static CreateEventTrigStmt *
|
||||
_copyCreateEventTrigStmt(const CreateEventTrigStmt *from)
|
||||
{
|
||||
CreateEventTrigStmt *newnode = makeNode(CreateEventTrigStmt);
|
||||
|
||||
COPY_STRING_FIELD(trigname);
|
||||
COPY_SCALAR_FIELD(eventname);
|
||||
COPY_NODE_FIELD(whenclause);
|
||||
COPY_NODE_FIELD(funcname);
|
||||
|
||||
return newnode;
|
||||
}
|
||||
|
||||
static AlterEventTrigStmt *
|
||||
_copyAlterEventTrigStmt(const AlterEventTrigStmt *from)
|
||||
{
|
||||
AlterEventTrigStmt *newnode = makeNode(AlterEventTrigStmt);
|
||||
|
||||
COPY_STRING_FIELD(trigname);
|
||||
COPY_SCALAR_FIELD(tgenabled);
|
||||
|
||||
return newnode;
|
||||
}
|
||||
|
||||
static CreatePLangStmt *
|
||||
_copyCreatePLangStmt(const CreatePLangStmt *from)
|
||||
{
|
||||
@ -4317,6 +4341,12 @@ copyObject(const void *from)
|
||||
case T_CreateTrigStmt:
|
||||
retval = _copyCreateTrigStmt(from);
|
||||
break;
|
||||
case T_CreateEventTrigStmt:
|
||||
retval = _copyCreateEventTrigStmt(from);
|
||||
break;
|
||||
case T_AlterEventTrigStmt:
|
||||
retval = _copyAlterEventTrigStmt(from);
|
||||
break;
|
||||
case T_CreatePLangStmt:
|
||||
retval = _copyCreatePLangStmt(from);
|
||||
break;
|
||||
|
Reference in New Issue
Block a user