diff options
author | Robert Haas | 2013-03-18 02:55:14 +0000 |
---|---|---|
committer | Robert Haas | 2013-03-18 02:57:26 +0000 |
commit | 05f3f9c7b2922b2a064418b5cd87b372d1b73412 (patch) | |
tree | 7532a7b338b36b659ddcfba50ebfcad22852e946 /src/backend/commands/trigger.c | |
parent | 6ac7facdd3990baf47efc124e9d7229422a06452 (diff) |
Extend object-access hook machinery to support post-alter events.
This also slightly widens the scope of what we support in terms of
post-create events.
KaiGai Kohei, with a few changes, mostly to the comments, by me
Diffstat (limited to 'src/backend/commands/trigger.c')
-rw-r--r-- | src/backend/commands/trigger.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/backend/commands/trigger.c b/src/backend/commands/trigger.c index f79cef508c1..bebb551f7fa 100644 --- a/src/backend/commands/trigger.c +++ b/src/backend/commands/trigger.c @@ -446,7 +446,8 @@ CreateTrigger(CreateTrigStmt *stmt, const char *queryString, NULL, true, /* islocal */ 0, /* inhcount */ - true); /* isnoinherit */ + true, /* isnoinherit */ + isInternal); /* is_internal */ } /* @@ -742,7 +743,8 @@ CreateTrigger(CreateTrigStmt *stmt, const char *queryString, DEPENDENCY_NORMAL); /* Post creation hook for new trigger */ - InvokeObjectPostCreateHook(TriggerRelationId, trigoid, 0); + InvokeObjectPostCreateHookArg(TriggerRelationId, trigoid, 0, + isInternal); /* Keep lock on target rel until end of xact */ heap_close(rel, NoLock); @@ -1276,6 +1278,9 @@ renametrig(RenameStmt *stmt) /* keep system catalog indexes current */ CatalogUpdateIndexes(tgrel, tuple); + InvokeObjectPostAlterHook(TriggerRelationId, + HeapTupleGetOid(tuple), 0); + /* * Invalidate relation's relcache entry so that other backends (and * this one too!) are sent SI message to make them rebuild relcache @@ -1391,6 +1396,9 @@ EnableDisableTrigger(Relation rel, const char *tgname, changed = true; } + + InvokeObjectPostAlterHook(TriggerRelationId, + HeapTupleGetOid(tuple), 0); } systable_endscan(tgscan); |