diff options
author | Robert Haas <rhaas@postgresql.org> | 2010-07-09 14:06:01 +0000 |
---|---|---|
committer | Robert Haas <rhaas@postgresql.org> | 2010-07-09 14:06:01 +0000 |
commit | f4122a8d50a56787770cb87e8269d6b48775ff4e (patch) | |
tree | 1e4a835e464124739d5106bffadef0631d5f0116 /src/backend/executor/execMain.c | |
parent | b40466c33731eed31e08f116487259d800eb1891 (diff) | |
download | postgresql-f4122a8d50a56787770cb87e8269d6b48775ff4e.tar.gz postgresql-f4122a8d50a56787770cb87e8269d6b48775ff4e.zip |
Add a hook in ExecCheckRTPerms().
This hook allows a loadable module to gain control when table permissions
are checked. It is expected to be used by an eventual SE-PostgreSQL
implementation, but there are other possible applications as well. A
sample contrib module can be found in the archives at:
http://archives.postgresql.org/pgsql-hackers/2010-05/msg01095.php
Robert Haas and Stephen Frost
Diffstat (limited to 'src/backend/executor/execMain.c')
-rw-r--r-- | src/backend/executor/execMain.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/backend/executor/execMain.c b/src/backend/executor/execMain.c index 0b6cbcc4af0..473fbcdae1c 100644 --- a/src/backend/executor/execMain.c +++ b/src/backend/executor/execMain.c @@ -26,7 +26,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/executor/execMain.c,v 1.349 2010/04/28 16:10:42 heikki Exp $ + * $PostgreSQL: pgsql/src/backend/executor/execMain.c,v 1.350 2010/07/09 14:06:01 rhaas Exp $ * *------------------------------------------------------------------------- */ @@ -63,6 +63,9 @@ ExecutorStart_hook_type ExecutorStart_hook = NULL; ExecutorRun_hook_type ExecutorRun_hook = NULL; ExecutorEnd_hook_type ExecutorEnd_hook = NULL; +/* Hook for plugin to get control in ExecCheckRTPerms() */ +ExecutorCheckPerms_hook_type ExecutorCheckPerms_hook = NULL; + /* decls for local routines only used within this module */ static void InitPlan(QueryDesc *queryDesc, int eflags); static void ExecEndPlan(PlanState *planstate, EState *estate); @@ -416,6 +419,9 @@ ExecCheckRTPerms(List *rangeTable) { ExecCheckRTEPerms((RangeTblEntry *) lfirst(l)); } + + if (ExecutorCheckPerms_hook) + (*ExecutorCheckPerms_hook)(rangeTable); } /* |