summaryrefslogtreecommitdiff
path: root/src/backend/commands/tablespace.c
diff options
context:
space:
mode:
authorRobert Haas2010-11-25 16:48:49 +0000
committerRobert Haas2010-11-25 16:50:13 +0000
commitcc1ed40d57aa68322e43a7b0a3320a6c5aff010a (patch)
tree9ea4ae8d86ab1e9709e16357a05040700acbe02a /src/backend/commands/tablespace.c
parentd3c126544342728ab4b5c167b4f4b01a39270db5 (diff)
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/tablespace.c')
-rw-r--r--src/backend/commands/tablespace.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/backend/commands/tablespace.c b/src/backend/commands/tablespace.c
index 305ac46b407..5ba0f1ca9da 100644
--- a/src/backend/commands/tablespace.c
+++ b/src/backend/commands/tablespace.c
@@ -59,6 +59,7 @@
#include "catalog/catalog.h"
#include "catalog/dependency.h"
#include "catalog/indexing.h"
+#include "catalog/objectaccess.h"
#include "catalog/pg_tablespace.h"
#include "commands/comment.h"
#include "commands/defrem.h"
@@ -333,6 +334,10 @@ CreateTableSpace(CreateTableSpaceStmt *stmt)
/* Record dependency on owner */
recordDependencyOnOwner(TableSpaceRelationId, tablespaceoid, ownerId);
+ /* Post creation hook for new tablespace */
+ InvokeObjectAccessHook(OAT_POST_CREATE,
+ TableSpaceRelationId, tablespaceoid, 0);
+
create_tablespace_directories(location, tablespaceoid);
/* Record the filesystem change in XLOG */