PostgreSQL Source Code
git master
Toggle main menu visibility
Main Page
Related Pages
Namespaces
Namespace List
Namespace Members
All
a
c
d
g
h
i
k
l
m
p
r
s
t
Functions
Variables
Data Structures
Data Structures
Data Structure Index
Class Hierarchy
Data Fields
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
_
a
c
d
f
h
i
n
o
p
r
s
t
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerations
Files
File List
Globals
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerations
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
Enumerator
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Macros
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
•
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Pages
usercontext.h
Go to the documentation of this file.
1
/*-------------------------------------------------------------------------
2
*
3
* usercontext.h
4
* Convenience functions for running code as a different database user.
5
*
6
*-------------------------------------------------------------------------
7
*/
8
#ifndef USERCONTEXT_H
9
#define USERCONTEXT_H
10
11
/*
12
* When temporarily changing to run as a different user, this structure
13
* holds the details needed to restore the original state.
14
*/
15
typedef
struct
UserContext
16
{
17
Oid
save_userid
;
18
int
save_sec_context
;
19
int
save_nestlevel
;
20
}
UserContext
;
21
22
/* Function prototypes. */
23
extern
void
SwitchToUntrustedUser
(
Oid
userid,
UserContext
*context);
24
extern
void
RestoreUserContext
(
UserContext
*context);
25
26
#endif
/* USERCONTEXT_H */
Oid
unsigned int Oid
Definition:
postgres_ext.h:30
UserContext
Definition:
usercontext.h:16
UserContext::save_sec_context
int save_sec_context
Definition:
usercontext.h:18
UserContext::save_userid
Oid save_userid
Definition:
usercontext.h:17
UserContext::save_nestlevel
int save_nestlevel
Definition:
usercontext.h:19
SwitchToUntrustedUser
void SwitchToUntrustedUser(Oid userid, UserContext *context)
Definition:
usercontext.c:33
RestoreUserContext
void RestoreUserContext(UserContext *context)
Definition:
usercontext.c:87
UserContext
struct UserContext UserContext
src
include
utils
usercontext.h
Generated on Sun Apr 13 2025 12:13:27 for PostgreSQL Source Code by
1.9.4