1
0
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:
Robert Haas
2013-03-17 22:55:14 -04:00
parent 6ac7facdd3
commit 05f3f9c7b2
31 changed files with 375 additions and 53 deletions

View File

@ -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);