Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf4122a8

Browse files
committed
Add a hook in ExecCheckRTPerms().
This hook allows a loadable module to gain control when table permissionsare checked. It is expected to be used by an eventual SE-PostgreSQLimplementation, but there are other possible applications as well. Asample contrib module can be found in the archives at:http://archives.postgresql.org/pgsql-hackers/2010-05/msg01095.phpRobert Haas and Stephen Frost
1 parentb40466c commitf4122a8

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

‎src/backend/executor/execMain.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
*
2727
*
2828
* IDENTIFICATION
29-
* $PostgreSQL: pgsql/src/backend/executor/execMain.c,v 1.349 2010/04/28 16:10:42 heikki Exp $
29+
* $PostgreSQL: pgsql/src/backend/executor/execMain.c,v 1.350 2010/07/09 14:06:01 rhaas Exp $
3030
*
3131
*-------------------------------------------------------------------------
3232
*/
@@ -63,6 +63,9 @@ ExecutorStart_hook_type ExecutorStart_hook = NULL;
6363
ExecutorRun_hook_typeExecutorRun_hook=NULL;
6464
ExecutorEnd_hook_typeExecutorEnd_hook=NULL;
6565

66+
/* Hook for plugin to get control in ExecCheckRTPerms() */
67+
ExecutorCheckPerms_hook_typeExecutorCheckPerms_hook=NULL;
68+
6669
/* decls for local routines only used within this module */
6770
staticvoidInitPlan(QueryDesc*queryDesc,inteflags);
6871
staticvoidExecEndPlan(PlanState*planstate,EState*estate);
@@ -416,6 +419,9 @@ ExecCheckRTPerms(List *rangeTable)
416419
{
417420
ExecCheckRTEPerms((RangeTblEntry*)lfirst(l));
418421
}
422+
423+
if (ExecutorCheckPerms_hook)
424+
(*ExecutorCheckPerms_hook)(rangeTable);
419425
}
420426

421427
/*

‎src/include/executor/executor.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group
88
* Portions Copyright (c) 1994, Regents of the University of California
99
*
10-
* $PostgreSQL: pgsql/src/include/executor/executor.h,v 1.168 2010/02/26 02:01:24 momjian Exp $
10+
* $PostgreSQL: pgsql/src/include/executor/executor.h,v 1.169 2010/07/09 14:06:01 rhaas Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -74,6 +74,10 @@ extern PGDLLIMPORT ExecutorRun_hook_type ExecutorRun_hook;
7474
typedefvoid (*ExecutorEnd_hook_type) (QueryDesc*queryDesc);
7575
externPGDLLIMPORTExecutorEnd_hook_typeExecutorEnd_hook;
7676

77+
/* Hook for plugins to get control in ExecCheckRTPerms() */
78+
typedefvoid (*ExecutorCheckPerms_hook_type) (List*);
79+
externPGDLLIMPORTExecutorCheckPerms_hook_typeExecutorCheckPerms_hook;
80+
7781

7882
/*
7983
* prototypes from functions in execAmi.c

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp