PostgreSQL Source Code  git master
session.h
Go to the documentation of this file.
1 /*-------------------------------------------------------------------------
2  *
3  * session.h
4  * Encapsulation of user session.
5  *
6  * Copyright (c) 2017-2019, PostgreSQL Global Development Group
7  *
8  * src/include/access/session.h
9  *
10  *-------------------------------------------------------------------------
11  */
12 #ifndef SESSION_H
13 #define SESSION_H
14 
15 #include "lib/dshash.h"
16 
17 /* Avoid including typcache.h */
19 
20 /*
21  * A struct encapsulating some elements of a user's session. For now this
22  * manages state that applies to parallel query, but it principle it could
23  * include other things that are currently global variables.
24  */
25 typedef struct Session
26 {
27  dsm_segment *segment; /* The session-scoped DSM segment. */
28  dsa_area *area; /* The session-scoped DSA area. */
29 
30  /* State managed by typcache.c. */
34 } Session;
35 
36 extern void InitializeSession(void);
37 extern dsm_handle GetSessionDsmHandle(void);
38 extern void AttachSession(dsm_handle handle);
39 extern void DetachSession(void);
40 
41 /* The current session, or NULL for none. */
42 extern Session *CurrentSession;
43 
44 #endif /* SESSION_H */
uint32 dsm_handle
Definition: dsm_impl.h:54
void InitializeSession(void)
Definition: session.c:54
dshash_table * shared_record_table
Definition: session.h:32
struct Session Session
dsa_area * area
Definition: session.h:28
struct SharedRecordTypmodRegistry * shared_typmod_registry
Definition: session.h:31
dshash_table * shared_typmod_table
Definition: session.h:33
void DetachSession(void)
Definition: session.c:201
dsm_handle GetSessionDsmHandle(void)
Definition: session.c:70
void AttachSession(dsm_handle handle)
Definition: session.c:155
Definition: dsa.c:354
Session * CurrentSession
Definition: session.c:48
dsm_segment * segment
Definition: session.h:27