PostgreSQL Source Code  git master
miscadmin.h
Go to the documentation of this file.
1 /*-------------------------------------------------------------------------
2  *
3  * miscadmin.h
4  * This file contains general postgres administration and initialization
5  * stuff that used to be spread out between the following files:
6  * globals.h global variables
7  * pdir.h directory path crud
8  * pinit.h postgres initialization
9  * pmod.h processing modes
10  * Over time, this has also become the preferred place for widely known
11  * resource-limitation stuff, such as work_mem and check_stack_depth().
12  *
13  * Portions Copyright (c) 1996-2021, PostgreSQL Global Development Group
14  * Portions Copyright (c) 1994, Regents of the University of California
15  *
16  * src/include/miscadmin.h
17  *
18  * NOTES
19  * some of the information in this file should be moved to other files.
20  *
21  *-------------------------------------------------------------------------
22  */
23 #ifndef MISCADMIN_H
24 #define MISCADMIN_H
25 
26 #include <signal.h>
27 
28 #include "datatype/timestamp.h" /* for TimestampTz */
29 #include "pgtime.h" /* for pg_time_t */
30 
31 
32 #define InvalidPid (-1)
33 
34 
35 /*****************************************************************************
36  * System interrupt and critical section handling
37  *
38  * There are two types of interrupts that a running backend needs to accept
39  * without messing up its state: QueryCancel (SIGINT) and ProcDie (SIGTERM).
40  * In both cases, we need to be able to clean up the current transaction
41  * gracefully, so we can't respond to the interrupt instantaneously ---
42  * there's no guarantee that internal data structures would be self-consistent
43  * if the code is interrupted at an arbitrary instant. Instead, the signal
44  * handlers set flags that are checked periodically during execution.
45  *
46  * The CHECK_FOR_INTERRUPTS() macro is called at strategically located spots
47  * where it is normally safe to accept a cancel or die interrupt. In some
48  * cases, we invoke CHECK_FOR_INTERRUPTS() inside low-level subroutines that
49  * might sometimes be called in contexts that do *not* want to allow a cancel
50  * or die interrupt. The HOLD_INTERRUPTS() and RESUME_INTERRUPTS() macros
51  * allow code to ensure that no cancel or die interrupt will be accepted,
52  * even if CHECK_FOR_INTERRUPTS() gets called in a subroutine. The interrupt
53  * will be held off until CHECK_FOR_INTERRUPTS() is done outside any
54  * HOLD_INTERRUPTS() ... RESUME_INTERRUPTS() section.
55  *
56  * There is also a mechanism to prevent query cancel interrupts, while still
57  * allowing die interrupts: HOLD_CANCEL_INTERRUPTS() and
58  * RESUME_CANCEL_INTERRUPTS().
59  *
60  * Special mechanisms are used to let an interrupt be accepted when we are
61  * waiting for a lock or when we are waiting for command input (but, of
62  * course, only if the interrupt holdoff counter is zero). See the
63  * related code for details.
64  *
65  * A lost connection is handled similarly, although the loss of connection
66  * does not raise a signal, but is detected when we fail to write to the
67  * socket. If there was a signal for a broken connection, we could make use of
68  * it by setting ClientConnectionLost in the signal handler.
69  *
70  * A related, but conceptually distinct, mechanism is the "critical section"
71  * mechanism. A critical section not only holds off cancel/die interrupts,
72  * but causes any ereport(ERROR) or ereport(FATAL) to become ereport(PANIC)
73  * --- that is, a system-wide reset is forced. Needless to say, only really
74  * *critical* code should be marked as a critical section! Currently, this
75  * mechanism is only used for XLOG-related code.
76  *
77  *****************************************************************************/
78 
79 /* in globals.c */
80 /* these are marked volatile because they are set by signal handlers: */
81 extern PGDLLIMPORT volatile sig_atomic_t InterruptPending;
82 extern PGDLLIMPORT volatile sig_atomic_t QueryCancelPending;
83 extern PGDLLIMPORT volatile sig_atomic_t ProcDiePending;
84 extern PGDLLIMPORT volatile sig_atomic_t IdleInTransactionSessionTimeoutPending;
85 extern PGDLLIMPORT volatile sig_atomic_t IdleSessionTimeoutPending;
86 extern PGDLLIMPORT volatile sig_atomic_t ProcSignalBarrierPending;
87 
88 extern PGDLLIMPORT volatile sig_atomic_t ClientConnectionLost;
89 
90 /* these are marked volatile because they are examined by signal handlers: */
93 extern PGDLLIMPORT volatile uint32 CritSectionCount;
94 
95 /* in tcop/postgres.c */
96 extern void ProcessInterrupts(void);
97 
98 #ifndef WIN32
99 
100 #define CHECK_FOR_INTERRUPTS() \
101 do { \
102  if (unlikely(InterruptPending)) \
103  ProcessInterrupts(); \
104 } while(0)
105 #else /* WIN32 */
106 
107 #define CHECK_FOR_INTERRUPTS() \
108 do { \
109  if (unlikely(UNBLOCKED_SIGNAL_QUEUE())) \
110  pgwin32_dispatch_queued_signals(); \
111  if (unlikely(InterruptPending)) \
112  ProcessInterrupts(); \
113 } while(0)
114 #endif /* WIN32 */
115 
116 
117 #define HOLD_INTERRUPTS() (InterruptHoldoffCount++)
118 
119 #define RESUME_INTERRUPTS() \
120 do { \
121  Assert(InterruptHoldoffCount > 0); \
122  InterruptHoldoffCount--; \
123 } while(0)
124 
125 #define HOLD_CANCEL_INTERRUPTS() (QueryCancelHoldoffCount++)
126 
127 #define RESUME_CANCEL_INTERRUPTS() \
128 do { \
129  Assert(QueryCancelHoldoffCount > 0); \
130  QueryCancelHoldoffCount--; \
131 } while(0)
132 
133 #define START_CRIT_SECTION() (CritSectionCount++)
134 
135 #define END_CRIT_SECTION() \
136 do { \
137  Assert(CritSectionCount > 0); \
138  CritSectionCount--; \
139 } while(0)
140 
141 
142 /*****************************************************************************
143  * globals.h -- *
144  *****************************************************************************/
145 
146 /*
147  * from utils/init/globals.c
148  */
149 extern PGDLLIMPORT pid_t PostmasterPid;
151 extern PGDLLIMPORT bool IsUnderPostmaster;
152 extern PGDLLIMPORT bool IsBackgroundWorker;
153 extern PGDLLIMPORT bool IsBinaryUpgrade;
154 
155 extern PGDLLIMPORT bool ExitOnAnyError;
156 
157 extern PGDLLIMPORT char *DataDir;
159 
160 extern PGDLLIMPORT int NBuffers;
161 extern PGDLLIMPORT int MaxBackends;
162 extern PGDLLIMPORT int MaxConnections;
165 
166 extern PGDLLIMPORT int MyProcPid;
169 extern PGDLLIMPORT struct Port *MyProcPort;
170 extern PGDLLIMPORT struct Latch *MyLatch;
171 extern int32 MyCancelKey;
172 extern int MyPMChildSlot;
173 
174 extern char OutputFileName[];
175 extern PGDLLIMPORT char my_exec_path[];
176 extern char pkglib_path[];
177 
178 #ifdef EXEC_BACKEND
179 extern char postgres_exec_path[];
180 #endif
181 
182 /*
183  * done in storage/backendid.h for now.
184  *
185  * extern BackendId MyBackendId;
186  */
188 
190 
191 /*
192  * Date/Time Configuration
193  *
194  * DateStyle defines the output formatting choice for date/time types:
195  * USE_POSTGRES_DATES specifies traditional Postgres format
196  * USE_ISO_DATES specifies ISO-compliant format
197  * USE_SQL_DATES specifies Oracle/Ingres-compliant format
198  * USE_GERMAN_DATES specifies German-style dd.mm/yyyy
199  *
200  * DateOrder defines the field order to be assumed when reading an
201  * ambiguous date (anything not in YYYY-MM-DD format, with a four-digit
202  * year field first, is taken to be ambiguous):
203  * DATEORDER_YMD specifies field order yy-mm-dd
204  * DATEORDER_DMY specifies field order dd-mm-yy ("European" convention)
205  * DATEORDER_MDY specifies field order mm-dd-yy ("US" convention)
206  *
207  * In the Postgres and SQL DateStyles, DateOrder also selects output field
208  * order: day comes before month in DMY style, else month comes before day.
209  *
210  * The user-visible "DateStyle" run-time parameter subsumes both of these.
211  */
212 
213 /* valid DateStyle values */
214 #define USE_POSTGRES_DATES 0
215 #define USE_ISO_DATES 1
216 #define USE_SQL_DATES 2
217 #define USE_GERMAN_DATES 3
218 #define USE_XSD_DATES 4
219 
220 /* valid DateOrder values */
221 #define DATEORDER_YMD 0
222 #define DATEORDER_DMY 1
223 #define DATEORDER_MDY 2
224 
225 extern PGDLLIMPORT int DateStyle;
226 extern PGDLLIMPORT int DateOrder;
227 
228 /*
229  * IntervalStyles
230  * INTSTYLE_POSTGRES Like Postgres < 8.4 when DateStyle = 'iso'
231  * INTSTYLE_POSTGRES_VERBOSE Like Postgres < 8.4 when DateStyle != 'iso'
232  * INTSTYLE_SQL_STANDARD SQL standard interval literals
233  * INTSTYLE_ISO_8601 ISO-8601-basic formatted intervals
234  */
235 #define INTSTYLE_POSTGRES 0
236 #define INTSTYLE_POSTGRES_VERBOSE 1
237 #define INTSTYLE_SQL_STANDARD 2
238 #define INTSTYLE_ISO_8601 3
239 
240 extern PGDLLIMPORT int IntervalStyle;
241 
242 #define MAXTZLEN 10 /* max TZ name len, not counting tr. null */
243 
244 extern bool enableFsync;
246 extern PGDLLIMPORT int work_mem;
247 extern PGDLLIMPORT double hash_mem_multiplier;
250 
251 extern int VacuumCostPageHit;
252 extern int VacuumCostPageMiss;
253 extern int VacuumCostPageDirty;
254 extern int VacuumCostLimit;
255 extern double VacuumCostDelay;
256 
257 extern int64 VacuumPageHit;
258 extern int64 VacuumPageMiss;
259 extern int64 VacuumPageDirty;
260 
261 extern int VacuumCostBalance;
262 extern bool VacuumCostActive;
263 
265 
266 
267 /* in tcop/postgres.c */
268 
269 #if defined(__ia64__) || defined(__ia64)
270 typedef struct
271 {
272  char *stack_base_ptr;
273  char *register_stack_base_ptr;
275 #else
276 typedef char *pg_stack_base_t;
277 #endif
278 
279 extern pg_stack_base_t set_stack_base(void);
280 extern void restore_stack_base(pg_stack_base_t base);
281 extern void check_stack_depth(void);
282 extern bool stack_is_too_deep(void);
283 
284 /* in tcop/utility.c */
285 extern void PreventCommandIfReadOnly(const char *cmdname);
286 extern void PreventCommandIfParallelMode(const char *cmdname);
287 extern void PreventCommandDuringRecovery(const char *cmdname);
288 
289 /* in utils/misc/guc.c */
290 extern int trace_recovery_messages;
291 extern int trace_recovery(int trace_level);
292 
293 /*****************************************************************************
294  * pdir.h -- *
295  * POSTGRES directory path definitions. *
296  *****************************************************************************/
297 
298 /* flags to be OR'd to form sec_context */
299 #define SECURITY_LOCAL_USERID_CHANGE 0x0001
300 #define SECURITY_RESTRICTED_OPERATION 0x0002
301 #define SECURITY_NOFORCE_RLS 0x0004
302 
303 extern char *DatabasePath;
304 
305 /* now in utils/init/miscinit.c */
306 extern void InitPostmasterChild(void);
307 extern void InitStandaloneProcess(const char *argv0);
308 extern void SwitchToSharedLatch(void);
309 extern void SwitchBackToLocalLatch(void);
310 
311 typedef enum BackendType
312 {
327 } BackendType;
328 
330 
331 extern const char *GetBackendTypeDesc(BackendType backendType);
332 
333 extern void SetDatabasePath(const char *path);
334 extern void checkDataDir(void);
335 extern void SetDataDir(const char *dir);
336 extern void ChangeToDataDir(void);
337 
338 extern char *GetUserNameFromId(Oid roleid, bool noerr);
339 extern Oid GetUserId(void);
340 extern Oid GetOuterUserId(void);
341 extern Oid GetSessionUserId(void);
342 extern Oid GetAuthenticatedUserId(void);
343 extern void GetUserIdAndSecContext(Oid *userid, int *sec_context);
344 extern void SetUserIdAndSecContext(Oid userid, int sec_context);
345 extern bool InLocalUserIdChange(void);
346 extern bool InSecurityRestrictedOperation(void);
347 extern bool InNoForceRLSOperation(void);
348 extern void GetUserIdAndContext(Oid *userid, bool *sec_def_context);
349 extern void SetUserIdAndContext(Oid userid, bool sec_def_context);
350 extern void InitializeSessionUserId(const char *rolename, Oid useroid);
351 extern void InitializeSessionUserIdStandalone(void);
352 extern void SetSessionAuthorization(Oid userid, bool is_superuser);
353 extern Oid GetCurrentRoleId(void);
354 extern void SetCurrentRoleId(Oid roleid, bool is_superuser);
355 
356 /* in utils/misc/superuser.c */
357 extern bool superuser(void); /* current user is superuser */
358 extern bool superuser_arg(Oid roleid); /* given user is superuser */
359 
360 
361 /*****************************************************************************
362  * pmod.h -- *
363  * POSTGRES processing mode definitions. *
364  *****************************************************************************/
365 
366 /*
367  * Description:
368  * There are three processing modes in POSTGRES. They are
369  * BootstrapProcessing or "bootstrap," InitProcessing or
370  * "initialization," and NormalProcessing or "normal."
371  *
372  * The first two processing modes are used during special times. When the
373  * system state indicates bootstrap processing, transactions are all given
374  * transaction id "one" and are consequently guaranteed to commit. This mode
375  * is used during the initial generation of template databases.
376  *
377  * Initialization mode: used while starting a backend, until all normal
378  * initialization is complete. Some code behaves differently when executed
379  * in this mode to enable system bootstrapping.
380  *
381  * If a POSTGRES backend process is in normal mode, then all code may be
382  * executed normally.
383  */
384 
385 typedef enum ProcessingMode
386 {
387  BootstrapProcessing, /* bootstrap creation of template database */
388  InitProcessing, /* initializing system */
389  NormalProcessing /* normal processing */
391 
392 extern ProcessingMode Mode;
393 
394 #define IsBootstrapProcessingMode() (Mode == BootstrapProcessing)
395 #define IsInitProcessingMode() (Mode == InitProcessing)
396 #define IsNormalProcessingMode() (Mode == NormalProcessing)
397 
398 #define GetProcessingMode() Mode
399 
400 #define SetProcessingMode(mode) \
401  do { \
402  AssertArg((mode) == BootstrapProcessing || \
403  (mode) == InitProcessing || \
404  (mode) == NormalProcessing); \
405  Mode = (mode); \
406  } while(0)
407 
408 
409 /*
410  * Auxiliary-process type identifiers. These used to be in bootstrap.h
411  * but it seems saner to have them here, with the ProcessingMode stuff.
412  * The MyAuxProcType global is defined and set in bootstrap.c.
413  */
414 
415 typedef enum
416 {
425 
426  NUM_AUXPROCTYPES /* Must be last! */
427 } AuxProcType;
428 
430 
431 #define AmBootstrapProcess() (MyAuxProcType == BootstrapProcess)
432 #define AmStartupProcess() (MyAuxProcType == StartupProcess)
433 #define AmBackgroundWriterProcess() (MyAuxProcType == BgWriterProcess)
434 #define AmCheckpointerProcess() (MyAuxProcType == CheckpointerProcess)
435 #define AmWalWriterProcess() (MyAuxProcType == WalWriterProcess)
436 #define AmWalReceiverProcess() (MyAuxProcType == WalReceiverProcess)
437 
438 
439 /*****************************************************************************
440  * pinit.h -- *
441  * POSTGRES initialization and cleanup definitions. *
442  *****************************************************************************/
443 
444 /* in utils/init/postinit.c */
445 extern void pg_split_opts(char **argv, int *argcp, const char *optstr);
446 extern void InitializeMaxBackends(void);
447 extern void InitPostgres(const char *in_dbname, Oid dboid, const char *username,
448  Oid useroid, char *out_dbname, bool override_allow_connections);
449 extern void BaseInit(void);
450 
451 /* in utils/init/miscinit.c */
452 extern bool IgnoreSystemIndexes;
456 extern char *local_preload_libraries_string;
457 
458 extern void CreateDataDirLockFile(bool amPostmaster);
459 extern void CreateSocketLockFile(const char *socketfile, bool amPostmaster,
460  const char *socketDir);
461 extern void TouchSocketLockFiles(void);
462 extern void AddToDataDirLockFile(int target_line, const char *str);
463 extern bool RecheckDataDirLockFile(void);
464 extern void ValidatePgVersion(const char *path);
465 extern void process_shared_preload_libraries(void);
466 extern void process_session_preload_libraries(void);
467 extern void pg_bindtextdomain(const char *domain);
468 extern bool has_rolreplication(Oid roleid);
469 
470 /* in access/transam/xlog.c */
471 extern bool BackupInProgress(void);
472 extern void CancelBackup(void);
473 
474 /* in executor/nodeHash.c */
475 extern int get_hash_mem(void);
476 
477 #endif /* MISCADMIN_H */
PGDLLIMPORT int max_worker_processes
Definition: globals.c:135
AuxProcType
Definition: miscadmin.h:415
PGDLLIMPORT bool IsPostmasterEnvironment
Definition: globals.c:109
PGDLLIMPORT int IntervalStyle
Definition: globals.c:118
PGDLLIMPORT volatile sig_atomic_t InterruptPending
Definition: globals.c:30
void SetUserIdAndSecContext(Oid userid, int sec_context)
Definition: miscinit.c:588
static char * argv0
Definition: pg_ctl.c:97
PGDLLIMPORT volatile sig_atomic_t QueryCancelPending
Definition: globals.c:31
int VacuumCostPageDirty
Definition: globals.c:141
int64 pg_time_t
Definition: pgtime.h:23
char OutputFileName[]
Definition: globals.c:71
bool stack_is_too_deep(void)
Definition: postgres.c:3391
void PreventCommandIfParallelMode(const char *cmdname)
Definition: utility.c:426
void InitializeSessionUserIdStandalone(void)
Definition: miscinit.c:778
char * DatabasePath
Definition: globals.c:94
int64 TimestampTz
Definition: timestamp.h:39
bool BackupInProgress(void)
Definition: xlog.c:11892
void SetUserIdAndContext(Oid userid, bool sec_def_context)
Definition: miscinit.c:637
void checkDataDir(void)
Definition: miscinit.c:302
bool has_rolreplication(Oid roleid)
Definition: miscinit.c:657
bool VacuumCostActive
Definition: globals.c:150
Oid GetUserId(void)
Definition: miscinit.c:476
bool InSecurityRestrictedOperation(void)
Definition: miscinit.c:608
ProcessingMode Mode
Definition: miscinit.c:60
void AddToDataDirLockFile(int target_line, const char *str)
Definition: miscinit.c:1329
Definition: libpq-be.h:120
bool superuser_arg(Oid roleid)
Definition: superuser.c:56
PGDLLIMPORT Oid MyDatabaseTableSpace
Definition: globals.c:88
void process_session_preload_libraries(void)
Definition: miscinit.c:1670
BackendType MyBackendType
Definition: miscinit.c:62
PGDLLIMPORT int maintenance_work_mem
Definition: globals.c:124
PGDLLIMPORT volatile sig_atomic_t ClientConnectionLost
Definition: globals.c:33
unsigned int Oid
Definition: postgres_ext.h:31
PGDLLIMPORT char * DataDir
Definition: globals.c:63
void InitializeMaxBackends(void)
Definition: postinit.c:515
PGDLLIMPORT struct Latch * MyLatch
Definition: globals.c:55
void PreventCommandIfReadOnly(const char *cmdname)
Definition: utility.c:408
void SetDatabasePath(const char *path)
Definition: miscinit.c:289
bool InLocalUserIdChange(void)
Definition: miscinit.c:599
#define PGDLLIMPORT
Definition: c.h:1317
char * shared_preload_libraries_string
Definition: miscinit.c:1592
signed int int32
Definition: c.h:429
const char * GetBackendTypeDesc(BackendType backendType)
Definition: miscinit.c:230
Oid GetOuterUserId(void)
Definition: miscinit.c:487
PGDLLIMPORT int MyProcPid
Definition: globals.c:41
AuxProcType MyAuxProcType
Definition: bootstrap.c:70
bool InNoForceRLSOperation(void)
Definition: miscinit.c:617
Oid GetAuthenticatedUserId(void)
Definition: miscinit.c:535
PGDLLIMPORT bool ExitOnAnyError
Definition: globals.c:114
void process_shared_preload_libraries(void)
Definition: miscinit.c:1657
int VacuumCostPageHit
Definition: globals.c:139
PGDLLIMPORT bool IsBackgroundWorker
Definition: globals.c:112
void CreateSocketLockFile(const char *socketfile, bool amPostmaster, const char *socketDir)
Definition: miscinit.c:1282
int trace_recovery_messages
Definition: guc.c:549
char * local_preload_libraries_string
Definition: miscinit.c:1593
int VacuumCostLimit
Definition: globals.c:142
char pkglib_path[]
Definition: globals.c:74
double vacuum_cleanup_index_scale_factor
Definition: globals.c:152
Definition: latch.h:110
int64 VacuumPageDirty
Definition: globals.c:147
bool enableFsync
Definition: globals.c:120
PGDLLIMPORT struct Port * MyProcPort
Definition: globals.c:44
PGDLLIMPORT int NBuffers
Definition: globals.c:133
PGDLLIMPORT pg_time_t MyStartTime
Definition: globals.c:42
PGDLLIMPORT TimestampTz MyStartTimestamp
Definition: globals.c:43
void check_stack_depth(void)
Definition: postgres.c:3377
char * session_preload_libraries_string
Definition: miscinit.c:1591
void InitStandaloneProcess(const char *argv0)
Definition: miscinit.c:165
unsigned int uint32
Definition: c.h:441
void SwitchBackToLocalLatch(void)
Definition: miscinit.c:216
bool superuser(void)
Definition: superuser.c:46
void ValidatePgVersion(const char *path)
Definition: miscinit.c:1528
PGDLLIMPORT volatile uint32 QueryCancelHoldoffCount
Definition: globals.c:38
PGDLLIMPORT volatile uint32 InterruptHoldoffCount
Definition: globals.c:37
void GetUserIdAndContext(Oid *userid, bool *sec_def_context)
Definition: miscinit.c:630
Oid GetSessionUserId(void)
Definition: miscinit.c:510
int get_hash_mem(void)
Definition: nodeHash.c:3389
PGDLLIMPORT int data_directory_mode
Definition: globals.c:69
int64 VacuumPageMiss
Definition: globals.c:146
void pg_bindtextdomain(const char *domain)
Definition: miscinit.c:1681
void SwitchToSharedLatch(void)
Definition: miscinit.c:197
void TouchSocketLockFiles(void)
Definition: miscinit.c:1300
void SetDataDir(const char *dir)
Definition: miscinit.c:395
void SetCurrentRoleId(Oid roleid, bool is_superuser)
Definition: miscinit.c:856
void CancelBackup(void)
Definition: xlog.c:11912
pg_stack_base_t set_stack_base(void)
Definition: postgres.c:3324
void pg_split_opts(char **argv, int *argcp, const char *optstr)
Definition: postinit.c:456
void SetSessionAuthorization(Oid userid, bool is_superuser)
Definition: miscinit.c:810
int trace_recovery(int trace_level)
Definition: elog.c:3602
PGDLLIMPORT volatile sig_atomic_t ProcSignalBarrierPending
Definition: globals.c:36
void restore_stack_base(pg_stack_base_t base)
Definition: postgres.c:3355
PGDLLIMPORT bool IsBinaryUpgrade
Definition: globals.c:111
void CreateDataDirLockFile(bool amPostmaster)
Definition: miscinit.c:1273
static char * username
Definition: initdb.c:134
int VacuumCostBalance
Definition: globals.c:149
PGDLLIMPORT bool allowSystemTableMods
Definition: globals.c:121
PGDLLIMPORT pid_t PostmasterPid
Definition: globals.c:96
int32 MyCancelKey
Definition: globals.c:45
char * GetUserNameFromId(Oid roleid, bool noerr)
Definition: miscinit.c:891
PGDLLIMPORT volatile sig_atomic_t IdleInTransactionSessionTimeoutPending
Definition: globals.c:34
PGDLLIMPORT bool IsUnderPostmaster
Definition: globals.c:110
void InitializeSessionUserId(const char *rolename, Oid useroid)
Definition: miscinit.c:675
PGDLLIMPORT int DateStyle
Definition: globals.c:116
void ChangeToDataDir(void)
Definition: miscinit.c:416
void GetUserIdAndSecContext(Oid *userid, int *sec_context)
Definition: miscinit.c:581
PGDLLIMPORT int work_mem
Definition: globals.c:122
ProcessingMode
Definition: miscadmin.h:385
PGDLLIMPORT volatile uint32 CritSectionCount
Definition: globals.c:39
static bool is_superuser(Archive *fout)
Definition: pg_dump.c:4202
bool RecheckDataDirLockFile(void)
Definition: miscinit.c:1456
char * stack_base_ptr
Definition: postgres.c:121
void ProcessInterrupts(void)
Definition: postgres.c:3065
int VacuumCostPageMiss
Definition: globals.c:140
PGDLLIMPORT char my_exec_path[]
Definition: globals.c:73
void BaseInit(void)
Definition: postinit.c:537
PGDLLIMPORT Oid MyDatabaseId
Definition: globals.c:86
PGDLLIMPORT int MaxConnections
Definition: globals.c:134
PGDLLIMPORT double hash_mem_multiplier
Definition: globals.c:123
PGDLLIMPORT int max_parallel_workers
Definition: globals.c:136
PGDLLIMPORT bool process_shared_preload_libraries_in_progress
Definition: miscinit.c:1596
BackendType
Definition: miscadmin.h:311
int MyPMChildSlot
Definition: globals.c:46
double VacuumCostDelay
Definition: globals.c:143
PGDLLIMPORT int MaxBackends
Definition: globals.c:137
void InitPostgres(const char *in_dbname, Oid dboid, const char *username, Oid useroid, char *out_dbname, bool override_allow_connections)
Definition: postinit.c:579
void PreventCommandDuringRecovery(const char *cmdname)
Definition: utility.c:445
bool IgnoreSystemIndexes
Definition: miscinit.c:79
PGDLLIMPORT int max_parallel_maintenance_workers
Definition: globals.c:125
PGDLLIMPORT volatile sig_atomic_t ProcDiePending
Definition: globals.c:32
Oid GetCurrentRoleId(void)
Definition: miscinit.c:835
char * pg_stack_base_t
Definition: miscadmin.h:276
void InitPostmasterChild(void)
Definition: miscinit.c:93
int64 VacuumPageHit
Definition: globals.c:145
PGDLLIMPORT volatile sig_atomic_t IdleSessionTimeoutPending
Definition: globals.c:35
PGDLLIMPORT int DateOrder
Definition: globals.c:117