mirror of
https://github.com/postgres/postgres.git
synced 2025-06-13 07:41:39 +03:00
Object access hook framework, with post-creation hook.
After a SQL object is created, we provide an opportunity for security or logging plugins to get control; for example, a security label provider could use this to assign an initial security label to newly created objects. The basic infrastructure is (hopefully) reusable for other types of events that might require similar treatment. KaiGai Kohei, with minor adjustments.
This commit is contained in:
@ -17,6 +17,7 @@
|
||||
#include "access/heapam.h"
|
||||
#include "catalog/dependency.h"
|
||||
#include "catalog/indexing.h"
|
||||
#include "catalog/objectaccess.h"
|
||||
#include "catalog/pg_language.h"
|
||||
#include "catalog/pg_namespace.h"
|
||||
#include "catalog/pg_pltemplate.h"
|
||||
@ -425,6 +426,10 @@ create_proc_lang(const char *languageName, bool replace,
|
||||
recordDependencyOn(&myself, &referenced, DEPENDENCY_NORMAL);
|
||||
}
|
||||
|
||||
/* Post creation hook for new procedural language */
|
||||
InvokeObjectAccessHook(OAT_POST_CREATE,
|
||||
LanguageRelationId, myself.objectId, 0);
|
||||
|
||||
heap_close(rel, RowExclusiveLock);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user