PostgreSQL Source Code
git master
rowsecurity.h
Go to the documentation of this file.
1
/* -------------------------------------------------------------------------
2
*
3
* rowsecurity.h
4
*
5
* prototypes for rewrite/rowsecurity.c and the structures for managing
6
* the row security policies for relations in relcache.
7
*
8
* Portions Copyright (c) 1996-2024, PostgreSQL Global Development Group
9
* Portions Copyright (c) 1994, Regents of the University of California
10
*
11
* -------------------------------------------------------------------------
12
*/
13
#ifndef ROWSECURITY_H
14
#define ROWSECURITY_H
15
16
#include "
nodes/parsenodes.h
"
17
#include "
utils/array.h
"
18
#include "
utils/relcache.h
"
19
20
typedef
struct
RowSecurityPolicy
21
{
22
char
*
policy_name
;
/* Name of the policy */
23
char
polcmd
;
/* Type of command policy is for */
24
ArrayType
*
roles
;
/* Array of roles policy is for */
25
bool
permissive
;
/* restrictive or permissive policy */
26
Expr
*
qual
;
/* Expression to filter rows */
27
Expr
*
with_check_qual
;
/* Expression to limit rows allowed */
28
bool
hassublinks
;
/* If either expression has sublinks */
29
}
RowSecurityPolicy
;
30
31
typedef
struct
RowSecurityDesc
32
{
33
MemoryContext
rscxt
;
/* row security memory context */
34
List
*
policies
;
/* list of row security policies */
35
}
RowSecurityDesc
;
36
37
typedef
List
*(*row_security_policy_hook_type) (
CmdType
cmdtype,
38
Relation
relation);
39
40
extern
PGDLLIMPORT
row_security_policy_hook_type
row_security_policy_hook_permissive
;
41
42
extern
PGDLLIMPORT
row_security_policy_hook_type
row_security_policy_hook_restrictive
;
43
44
extern
void
get_row_security_policies
(
Query
*
root
,
45
RangeTblEntry
*rte,
int
rt_index,
46
List
**securityQuals,
List
**withCheckOptions,
47
bool
*hasRowSecurity,
bool
*hasSubLinks);
48
49
#endif
/* ROWSECURITY_H */
array.h
PGDLLIMPORT
#define PGDLLIMPORT
Definition:
c.h:1319
CmdType
CmdType
Definition:
nodes.h:263
parsenodes.h
root
tree ctl root
Definition:
radixtree.h:1886
relcache.h
RowSecurityPolicy
struct RowSecurityPolicy RowSecurityPolicy
row_security_policy_hook_restrictive
PGDLLIMPORT row_security_policy_hook_type row_security_policy_hook_restrictive
Definition:
rowsecurity.c:87
RowSecurityDesc
struct RowSecurityDesc RowSecurityDesc
row_security_policy_hook_permissive
PGDLLIMPORT row_security_policy_hook_type row_security_policy_hook_permissive
Definition:
rowsecurity.c:86
row_security_policy_hook_type
List *(* row_security_policy_hook_type)(CmdType cmdtype, Relation relation)
Definition:
rowsecurity.h:37
get_row_security_policies
void get_row_security_policies(Query *root, RangeTblEntry *rte, int rt_index, List **securityQuals, List **withCheckOptions, bool *hasRowSecurity, bool *hasSubLinks)
Definition:
rowsecurity.c:98
ArrayType
Definition:
array.h:93
Expr
Definition:
primnodes.h:188
List
Definition:
pg_list.h:54
MemoryContextData
Definition:
memnodes.h:118
Query
Definition:
parsenodes.h:118
RangeTblEntry
Definition:
parsenodes.h:1032
RelationData
Definition:
rel.h:56
RowSecurityDesc
Definition:
rowsecurity.h:32
RowSecurityDesc::policies
List * policies
Definition:
rowsecurity.h:34
RowSecurityDesc::rscxt
MemoryContext rscxt
Definition:
rowsecurity.h:33
RowSecurityPolicy
Definition:
rowsecurity.h:21
RowSecurityPolicy::roles
ArrayType * roles
Definition:
rowsecurity.h:24
RowSecurityPolicy::qual
Expr * qual
Definition:
rowsecurity.h:26
RowSecurityPolicy::polcmd
char polcmd
Definition:
rowsecurity.h:23
RowSecurityPolicy::with_check_qual
Expr * with_check_qual
Definition:
rowsecurity.h:27
RowSecurityPolicy::hassublinks
bool hassublinks
Definition:
rowsecurity.h:28
RowSecurityPolicy::policy_name
char * policy_name
Definition:
rowsecurity.h:22
RowSecurityPolicy::permissive
bool permissive
Definition:
rowsecurity.h:25
src
include
rewrite
rowsecurity.h
Generated on Fri Oct 11 2024 12:13:25 for PostgreSQL Source Code by
1.9.1