mirror of
https://github.com/postgres/postgres.git
synced 2025-06-16 06:01:02 +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:
@ -32,6 +32,7 @@
|
||||
#include "catalog/catalog.h"
|
||||
#include "catalog/dependency.h"
|
||||
#include "catalog/indexing.h"
|
||||
#include "catalog/objectaccess.h"
|
||||
#include "catalog/pg_authid.h"
|
||||
#include "catalog/pg_database.h"
|
||||
#include "catalog/pg_db_role_setting.h"
|
||||
@ -572,6 +573,9 @@ createdb(const CreatedbStmt *stmt)
|
||||
/* Create pg_shdepend entries for objects within database */
|
||||
copyTemplateDependencies(src_dboid, dboid);
|
||||
|
||||
/* Post creation hook for new database */
|
||||
InvokeObjectAccessHook(OAT_POST_CREATE, DatabaseRelationId, dboid, 0);
|
||||
|
||||
/*
|
||||
* Force a checkpoint before starting the copy. This will force dirty
|
||||
* buffers out to disk, to ensure source database is up-to-date on disk
|
||||
|
Reference in New Issue
Block a user