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-2024, 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 in 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. */
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. */
43 
44 #endif /* SESSION_H */
#define PGDLLIMPORT
Definition: c.h:1319
uint32 dsm_handle
Definition: dsm_impl.h:55
struct Session Session
void InitializeSession(void)
Definition: session.c:54
void DetachSession(void)
Definition: session.c:201
void AttachSession(dsm_handle handle)
Definition: session.c:155
dsm_handle GetSessionDsmHandle(void)
Definition: session.c:70
PGDLLIMPORT Session * CurrentSession
Definition: session.c:48
dsm_segment * segment
Definition: session.h:27
dshash_table * shared_record_table
Definition: session.h:32
struct SharedRecordTypmodRegistry * shared_typmod_registry
Definition: session.h:31
dsa_area * area
Definition: session.h:28
dshash_table * shared_typmod_table
Definition: session.h:33
Definition: dsa.c:348