aboutsummaryrefslogtreecommitdiff
path: root/src/backend/commands/dbcommands.c
diff options
context:
space:
mode:
authorRobert Haas <rhaas@postgresql.org>2010-11-25 11:48:49 -0500
committerRobert Haas <rhaas@postgresql.org>2010-11-25 11:50:13 -0500
commitcc1ed40d57aa68322e43a7b0a3320a6c5aff010a (patch)
tree9ea4ae8d86ab1e9709e16357a05040700acbe02a /src/backend/commands/dbcommands.c
parentd3c126544342728ab4b5c167b4f4b01a39270db5 (diff)
downloadpostgresql-cc1ed40d57aa68322e43a7b0a3320a6c5aff010a.tar.gz
postgresql-cc1ed40d57aa68322e43a7b0a3320a6c5aff010a.zip
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.
Diffstat (limited to 'src/backend/commands/dbcommands.c')
-rw-r--r--src/backend/commands/dbcommands.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/backend/commands/dbcommands.c b/src/backend/commands/dbcommands.c
index 8cbd7548f97..09c6632a3b7 100644
--- a/src/backend/commands/dbcommands.c
+++ b/src/backend/commands/dbcommands.c
@@ -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