PostgreSQL Source Code  git master
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 {
21 
22 /* Function prototypes. */
23 extern void SwitchToUntrustedUser(Oid userid, UserContext *context);
25 
26 #endif /* USERCONTEXT_H */
unsigned int Oid
Definition: postgres_ext.h:31
tree context
Definition: radixtree.h:1833
int save_sec_context
Definition: usercontext.h:18
Oid save_userid
Definition: usercontext.h:17
int save_nestlevel
Definition: usercontext.h:19
void SwitchToUntrustedUser(Oid userid, UserContext *context)
Definition: usercontext.c:33
void RestoreUserContext(UserContext *context)
Definition: usercontext.c:87
struct UserContext UserContext