mirror of
https://github.com/postgres/postgres.git
synced 2025-06-30 21:42:05 +03:00
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
This commit is contained in:
@ -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);
|
||||
|
Reference in New Issue
Block a user