mirror of
https://github.com/postgres/postgres.git
synced 2025-07-17 06:41:09 +03:00
Allow FOR EACH ROW triggers on partitioned tables
Previously, FOR EACH ROW triggers were not allowed in partitioned tables. Now we allow AFTER triggers on them, and on trigger creation we cascade to create an identical trigger in each partition. We also clone the triggers to each partition that is created or attached later. This means that deferred unique keys are allowed on partitioned tables, too. Author: Álvaro Herrera Reviewed-by: Peter Eisentraut, Simon Riggs, Amit Langote, Robert Haas, Thomas Munro Discussion: https://postgr.es/m/20171229225319.ajltgss2ojkfd3kp@alvherre.pgsql
This commit is contained in:
@ -159,7 +159,8 @@ extern PGDLLIMPORT int SessionReplicationRole;
|
||||
|
||||
extern ObjectAddress CreateTrigger(CreateTrigStmt *stmt, const char *queryString,
|
||||
Oid relOid, Oid refRelOid, Oid constraintOid, Oid indexOid,
|
||||
bool isInternal);
|
||||
Oid funcoid, Oid parentTriggerOid, Node *whenClause,
|
||||
bool isInternal, bool in_partition);
|
||||
|
||||
extern void RemoveTriggerById(Oid trigOid);
|
||||
extern Oid get_trigger_oid(Oid relid, const char *name, bool missing_ok);
|
||||
@ -167,7 +168,7 @@ extern Oid get_trigger_oid(Oid relid, const char *name, bool missing_ok);
|
||||
extern ObjectAddress renametrig(RenameStmt *stmt);
|
||||
|
||||
extern void EnableDisableTrigger(Relation rel, const char *tgname,
|
||||
char fires_when, bool skip_system);
|
||||
char fires_when, bool skip_system, LOCKMODE lockmode);
|
||||
|
||||
extern void RelationBuildTriggers(Relation relation);
|
||||
|
||||
|
Reference in New Issue
Block a user