1
0
mirror of https://github.com/postgres/postgres.git synced 2025-12-21 05:21:08 +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:
Kevin Grittner
2016-11-04 10:49:50 -05:00
parent 69d590fffb
commit 8c48375e5f
16 changed files with 580 additions and 43 deletions

View File

@@ -39,6 +39,8 @@ typedef struct Trigger
int16 *tgattr;
char **tgargs;
char *tgqual;
char *tgoldtable;
char *tgnewtable;
} Trigger;
typedef struct TriggerDesc
@@ -68,6 +70,11 @@ typedef struct TriggerDesc
/* there are no row-level truncate triggers */
bool trig_truncate_before_statement;
bool trig_truncate_after_statement;
/* Is there at least one trigger specifying each transition relation? */
bool trig_insert_new_table;
bool trig_update_old_table;
bool trig_update_new_table;
bool trig_delete_old_table;
} TriggerDesc;
#endif /* RELTRIGGER_H */