mirror of
https://github.com/postgres/postgres.git
synced 2025-07-18 17:42:25 +03:00
Implement syntax for transition tables in AFTER triggers.
This is infrastructure for the complete SQL standard feature. No support is included at this point for execution nodes or PLs. The intent is to add that soon. As this patch leaves things, standard syntax can create tuplestores to contain old and/or new versions of rows affected by a statement. References to these tuplestores are in the TriggerData structure. C triggers can access the tuplestores directly, so they are usable, but they cannot yet be referenced within a SQL statement.
This commit is contained in:
@ -2561,6 +2561,16 @@ _outXmlSerialize(StringInfo str, const XmlSerialize *node)
|
||||
WRITE_LOCATION_FIELD(location);
|
||||
}
|
||||
|
||||
static void
|
||||
_outTriggerTransition(StringInfo str, const TriggerTransition *node)
|
||||
{
|
||||
WRITE_NODE_TYPE("TRIGGERTRANSITION");
|
||||
|
||||
WRITE_STRING_FIELD(name);
|
||||
WRITE_BOOL_FIELD(isNew);
|
||||
WRITE_BOOL_FIELD(isTable);
|
||||
}
|
||||
|
||||
static void
|
||||
_outColumnDef(StringInfo str, const ColumnDef *node)
|
||||
{
|
||||
@ -3852,6 +3862,9 @@ outNode(StringInfo str, const void *obj)
|
||||
case T_ForeignKeyCacheInfo:
|
||||
_outForeignKeyCacheInfo(str, obj);
|
||||
break;
|
||||
case T_TriggerTransition:
|
||||
_outTriggerTransition(str, obj);
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
|
Reference in New Issue
Block a user