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  * Note that ProcessInterrupts() has also acquired a number of tasks that
61  * do not necessarily cause a query-cancel-or-die response. Hence, it's
62  * possible that it will just clear InterruptPending and return.
63  *
64  * INTERRUPTS_PENDING_CONDITION() can be checked to see whether an
65  * interrupt needs to be serviced, without trying to do so immediately.
66  * Some callers are also interested in INTERRUPTS_CAN_BE_PROCESSED(),
67  * which tells whether ProcessInterrupts is sure to clear the interrupt.
68  *
69  * Special mechanisms are used to let an interrupt be accepted when we are
70  * waiting for a lock or when we are waiting for command input (but, of
71  * course, only if the interrupt holdoff counter is zero). See the
72  * related code for details.
73  *
74  * A lost connection is handled similarly, although the loss of connection
75  * does not raise a signal, but is detected when we fail to write to the
76  * socket. If there was a signal for a broken connection, we could make use of
77  * it by setting ClientConnectionLost in the signal handler.
78  *
79  * A related, but conceptually distinct, mechanism is the "critical section"
80  * mechanism. A critical section not only holds off cancel/die interrupts,
81  * but causes any ereport(ERROR) or ereport(FATAL) to become ereport(PANIC)
82  * --- that is, a system-wide reset is forced. Needless to say, only really
83  * *critical* code should be marked as a critical section! Currently, this
84  * mechanism is only used for XLOG-related code.
85  *
86  *****************************************************************************/
87 
88 /* in globals.c */
89 /* these are marked volatile because they are set by signal handlers: */
90 extern PGDLLIMPORT volatile sig_atomic_t InterruptPending;
91 extern PGDLLIMPORT volatile sig_atomic_t QueryCancelPending;
92 extern PGDLLIMPORT volatile sig_atomic_t ProcDiePending;
93 extern PGDLLIMPORT volatile sig_atomic_t IdleInTransactionSessionTimeoutPending;
94 extern PGDLLIMPORT volatile sig_atomic_t IdleSessionTimeoutPending;
95 extern PGDLLIMPORT volatile sig_atomic_t ProcSignalBarrierPending;
96 extern PGDLLIMPORT volatile sig_atomic_t LogMemoryContextPending;
97 
98 extern PGDLLIMPORT volatile sig_atomic_t CheckClientConnectionPending;
99 extern PGDLLIMPORT volatile sig_atomic_t ClientConnectionLost;
100 
101 /* these are marked volatile because they are examined by signal handlers: */
104 extern PGDLLIMPORT volatile uint32 CritSectionCount;
105 
106 /* in tcop/postgres.c */
107 extern void ProcessInterrupts(void);
108 
109 /* Test whether an interrupt is pending */
110 #ifndef WIN32
111 #define INTERRUPTS_PENDING_CONDITION() \
112  (unlikely(InterruptPending))
113 #else
114 #define INTERRUPTS_PENDING_CONDITION() \
115  (unlikely(UNBLOCKED_SIGNAL_QUEUE()) ? pgwin32_dispatch_queued_signals() : 0, \
116  unlikely(InterruptPending))
117 #endif
118 
119 /* Service interrupt, if one is pending and it's safe to service it now */
120 #define CHECK_FOR_INTERRUPTS() \
121 do { \
122  if (INTERRUPTS_PENDING_CONDITION()) \
123  ProcessInterrupts(); \
124 } while(0)
125 
126 /* Is ProcessInterrupts() guaranteed to clear InterruptPending? */
127 #define INTERRUPTS_CAN_BE_PROCESSED() \
128  (InterruptHoldoffCount == 0 && CritSectionCount == 0 && \
129  QueryCancelHoldoffCount == 0)
130 
131 #define HOLD_INTERRUPTS() (InterruptHoldoffCount++)
132 
133 #define RESUME_INTERRUPTS() \
134 do { \
135  Assert(InterruptHoldoffCount > 0); \
136  InterruptHoldoffCount--; \
137 } while(0)
138 
139 #define HOLD_CANCEL_INTERRUPTS() (QueryCancelHoldoffCount++)
140 
141 #define RESUME_CANCEL_INTERRUPTS() \
142 do { \
143  Assert(QueryCancelHoldoffCount > 0); \
144  QueryCancelHoldoffCount--; \
145 } while(0)
146 
147 #define START_CRIT_SECTION() (CritSectionCount++)
148 
149 #define END_CRIT_SECTION() \
150 do { \
151  Assert(CritSectionCount > 0); \
152  CritSectionCount--; \
153 } while(0)
154 
155 
156 /*****************************************************************************
157  * globals.h -- *
158  *****************************************************************************/
159 
160 /*
161  * from utils/init/globals.c
162  */
163 extern PGDLLIMPORT pid_t PostmasterPid;
165 extern PGDLLIMPORT bool IsUnderPostmaster;
166 extern PGDLLIMPORT bool IsBackgroundWorker;
167 extern PGDLLIMPORT bool IsBinaryUpgrade;
168 
169 extern PGDLLIMPORT bool ExitOnAnyError;
170 
171 extern PGDLLIMPORT char *DataDir;
173 
174 extern PGDLLIMPORT int NBuffers;
175 extern PGDLLIMPORT int MaxBackends;
176 extern PGDLLIMPORT int MaxConnections;
179 
180 extern PGDLLIMPORT int MyProcPid;
183 extern PGDLLIMPORT struct Port *MyProcPort;
184 extern PGDLLIMPORT struct Latch *MyLatch;
185 extern int32 MyCancelKey;
186 extern int MyPMChildSlot;
187 
188 extern char OutputFileName[];
189 extern PGDLLIMPORT char my_exec_path[];
190 extern char pkglib_path[];
191 
192 #ifdef EXEC_BACKEND
193 extern char postgres_exec_path[];
194 #endif
195 
196 /*
197  * done in storage/backendid.h for now.
198  *
199  * extern BackendId MyBackendId;
200  */
202 
204 
205 /*
206  * Date/Time Configuration
207  *
208  * DateStyle defines the output formatting choice for date/time types:
209  * USE_POSTGRES_DATES specifies traditional Postgres format
210  * USE_ISO_DATES specifies ISO-compliant format
211  * USE_SQL_DATES specifies Oracle/Ingres-compliant format
212  * USE_GERMAN_DATES specifies German-style dd.mm/yyyy
213  *
214  * DateOrder defines the field order to be assumed when reading an
215  * ambiguous date (anything not in YYYY-MM-DD format, with a four-digit
216  * year field first, is taken to be ambiguous):
217  * DATEORDER_YMD specifies field order yy-mm-dd
218  * DATEORDER_DMY specifies field order dd-mm-yy ("European" convention)
219  * DATEORDER_MDY specifies field order mm-dd-yy ("US" convention)
220  *
221  * In the Postgres and SQL DateStyles, DateOrder also selects output field
222  * order: day comes before month in DMY style, else month comes before day.
223  *
224  * The user-visible "DateStyle" run-time parameter subsumes both of these.
225  */
226 
227 /* valid DateStyle values */
228 #define USE_POSTGRES_DATES 0
229 #define USE_ISO_DATES 1
230 #define USE_SQL_DATES 2
231 #define USE_GERMAN_DATES 3
232 #define USE_XSD_DATES 4
233 
234 /* valid DateOrder values */
235 #define DATEORDER_YMD 0
236 #define DATEORDER_DMY 1
237 #define DATEORDER_MDY 2
238 
239 extern PGDLLIMPORT int DateStyle;
240 extern PGDLLIMPORT int DateOrder;
241 
242 /*
243  * IntervalStyles
244  * INTSTYLE_POSTGRES Like Postgres < 8.4 when DateStyle = 'iso'
245  * INTSTYLE_POSTGRES_VERBOSE Like Postgres < 8.4 when DateStyle != 'iso'
246  * INTSTYLE_SQL_STANDARD SQL standard interval literals
247  * INTSTYLE_ISO_8601 ISO-8601-basic formatted intervals
248  */
249 #define INTSTYLE_POSTGRES 0
250 #define INTSTYLE_POSTGRES_VERBOSE 1
251 #define INTSTYLE_SQL_STANDARD 2
252 #define INTSTYLE_ISO_8601 3
253 
254 extern PGDLLIMPORT int IntervalStyle;
255 
256 #define MAXTZLEN 10 /* max TZ name len, not counting tr. null */
257 
258 extern bool enableFsync;
260 extern PGDLLIMPORT int work_mem;
261 extern PGDLLIMPORT double hash_mem_multiplier;
264 
265 extern int VacuumCostPageHit;
266 extern int VacuumCostPageMiss;
267 extern int VacuumCostPageDirty;
268 extern int VacuumCostLimit;
269 extern double VacuumCostDelay;
270 
271 extern int64 VacuumPageHit;
272 extern int64 VacuumPageMiss;
273 extern int64 VacuumPageDirty;
274 
275 extern int VacuumCostBalance;
276 extern bool VacuumCostActive;
277 
278 
279 /* in tcop/postgres.c */
280 
281 #if defined(__ia64__) || defined(__ia64)
282 typedef struct
283 {
284  char *stack_base_ptr;
285  char *register_stack_base_ptr;
287 #else
288 typedef char *pg_stack_base_t;
289 #endif
290 
291 extern pg_stack_base_t set_stack_base(void);
292 extern void restore_stack_base(pg_stack_base_t base);
293 extern void check_stack_depth(void);
294 extern bool stack_is_too_deep(void);
295 
296 /* in tcop/utility.c */
297 extern void PreventCommandIfReadOnly(const char *cmdname);
298 extern void PreventCommandIfParallelMode(const char *cmdname);
299 extern void PreventCommandDuringRecovery(const char *cmdname);
300 
301 /* in utils/misc/guc.c */
302 extern int trace_recovery_messages;
303 extern int trace_recovery(int trace_level);
304 
305 /*****************************************************************************
306  * pdir.h -- *
307  * POSTGRES directory path definitions. *
308  *****************************************************************************/
309 
310 /* flags to be OR'd to form sec_context */
311 #define SECURITY_LOCAL_USERID_CHANGE 0x0001
312 #define SECURITY_RESTRICTED_OPERATION 0x0002
313 #define SECURITY_NOFORCE_RLS 0x0004
314 
315 extern char *DatabasePath;
316 
317 /* now in utils/init/miscinit.c */
318 extern void InitPostmasterChild(void);
319 extern void InitStandaloneProcess(const char *argv0);
320 extern void SwitchToSharedLatch(void);
321 extern void SwitchBackToLocalLatch(void);
322 
323 typedef enum BackendType
324 {
339 } BackendType;
340 
342 
343 extern const char *GetBackendTypeDesc(BackendType backendType);
344 
345 extern void SetDatabasePath(const char *path);
346 extern void checkDataDir(void);
347 extern void SetDataDir(const char *dir);
348 extern void ChangeToDataDir(void);
349 
350 extern char *GetUserNameFromId(Oid roleid, bool noerr);
351 extern Oid GetUserId(void);
352 extern Oid GetOuterUserId(void);
353 extern Oid GetSessionUserId(void);
354 extern Oid GetAuthenticatedUserId(void);
355 extern void GetUserIdAndSecContext(Oid *userid, int *sec_context);
356 extern void SetUserIdAndSecContext(Oid userid, int sec_context);
357 extern bool InLocalUserIdChange(void);
358 extern bool InSecurityRestrictedOperation(void);
359 extern bool InNoForceRLSOperation(void);
360 extern void GetUserIdAndContext(Oid *userid, bool *sec_def_context);
361 extern void SetUserIdAndContext(Oid userid, bool sec_def_context);
362 extern void InitializeSessionUserId(const char *rolename, Oid useroid);
363 extern void InitializeSessionUserIdStandalone(void);
364 extern void SetSessionAuthorization(Oid userid, bool is_superuser);
365 extern Oid GetCurrentRoleId(void);
366 extern void SetCurrentRoleId(Oid roleid, bool is_superuser);
367 
368 /* in utils/misc/superuser.c */
369 extern bool superuser(void); /* current user is superuser */
370 extern bool superuser_arg(Oid roleid); /* given user is superuser */
371 
372 
373 /*****************************************************************************
374  * pmod.h -- *
375  * POSTGRES processing mode definitions. *
376  *****************************************************************************/
377 
378 /*
379  * Description:
380  * There are three processing modes in POSTGRES. They are
381  * BootstrapProcessing or "bootstrap," InitProcessing or
382  * "initialization," and NormalProcessing or "normal."
383  *
384  * The first two processing modes are used during special times. When the
385  * system state indicates bootstrap processing, transactions are all given
386  * transaction id "one" and are consequently guaranteed to commit. This mode
387  * is used during the initial generation of template databases.
388  *
389  * Initialization mode: used while starting a backend, until all normal
390  * initialization is complete. Some code behaves differently when executed
391  * in this mode to enable system bootstrapping.
392  *
393  * If a POSTGRES backend process is in normal mode, then all code may be
394  * executed normally.
395  */
396 
397 typedef enum ProcessingMode
398 {
399  BootstrapProcessing, /* bootstrap creation of template database */
400  InitProcessing, /* initializing system */
401  NormalProcessing /* normal processing */
403 
404 extern ProcessingMode Mode;
405 
406 #define IsBootstrapProcessingMode() (Mode == BootstrapProcessing)
407 #define IsInitProcessingMode() (Mode == InitProcessing)
408 #define IsNormalProcessingMode() (Mode == NormalProcessing)
409 
410 #define GetProcessingMode() Mode
411 
412 #define SetProcessingMode(mode) \
413  do { \
414  AssertArg((mode) == BootstrapProcessing || \
415  (mode) == InitProcessing || \
416  (mode) == NormalProcessing); \
417  Mode = (mode); \
418  } while(0)
419 
420 
421 /*
422  * Auxiliary-process type identifiers. These used to be in bootstrap.h
423  * but it seems saner to have them here, with the ProcessingMode stuff.
424  * The MyAuxProcType global is defined and set in auxprocess.c.
425  *
426  * Make sure to list in the glossary any items you add here.
427  */
428 
429 typedef enum
430 {
438 
439  NUM_AUXPROCTYPES /* Must be last! */
440 } AuxProcType;
441 
443 
444 #define AmStartupProcess() (MyAuxProcType == StartupProcess)
445 #define AmBackgroundWriterProcess() (MyAuxProcType == BgWriterProcess)
446 #define AmArchiverProcess() (MyAuxProcType == ArchiverProcess)
447 #define AmCheckpointerProcess() (MyAuxProcType == CheckpointerProcess)
448 #define AmWalWriterProcess() (MyAuxProcType == WalWriterProcess)
449 #define AmWalReceiverProcess() (MyAuxProcType == WalReceiverProcess)
450 
451 
452 /*****************************************************************************
453  * pinit.h -- *
454  * POSTGRES initialization and cleanup definitions. *
455  *****************************************************************************/
456 
457 /* in utils/init/postinit.c */
458 extern void pg_split_opts(char **argv, int *argcp, const char *optstr);
459 extern void InitializeMaxBackends(void);
460 extern void InitPostgres(const char *in_dbname, Oid dboid, const char *username,
461  Oid useroid, char *out_dbname, bool override_allow_connections);
462 extern void BaseInit(void);
463 
464 /* in utils/init/miscinit.c */
465 extern bool IgnoreSystemIndexes;
469 extern char *local_preload_libraries_string;
470 
471 extern void CreateDataDirLockFile(bool amPostmaster);
472 extern void CreateSocketLockFile(const char *socketfile, bool amPostmaster,
473  const char *socketDir);
474 extern void TouchSocketLockFiles(void);
475 extern void AddToDataDirLockFile(int target_line, const char *str);
476 extern bool RecheckDataDirLockFile(void);
477 extern void ValidatePgVersion(const char *path);
478 extern void process_shared_preload_libraries(void);
479 extern void process_session_preload_libraries(void);
480 extern void pg_bindtextdomain(const char *domain);
481 extern bool has_rolreplication(Oid roleid);
482 
483 /* in access/transam/xlog.c */
484 extern bool BackupInProgress(void);
485 extern void CancelBackup(void);
486 
487 /* in executor/nodeHash.c */
488 extern size_t get_hash_memory_limit(void);
489 
490 #endif /* MISCADMIN_H */
PGDLLIMPORT int max_worker_processes
Definition: globals.c:137
AuxProcType
Definition: miscadmin.h:429
PGDLLIMPORT bool IsPostmasterEnvironment
Definition: globals.c:111
PGDLLIMPORT int IntervalStyle
Definition: globals.c:120
PGDLLIMPORT volatile sig_atomic_t InterruptPending
Definition: globals.c:30
PGDLLIMPORT volatile sig_atomic_t LogMemoryContextPending
Definition: globals.c:38
void SetUserIdAndSecContext(Oid userid, int sec_context)
Definition: miscinit.c:607
static char * argv0
Definition: pg_ctl.c:97
PGDLLIMPORT volatile sig_atomic_t QueryCancelPending
Definition: globals.c:31
int VacuumCostPageDirty
Definition: globals.c:143
int64 pg_time_t
Definition: pgtime.h:23
char OutputFileName[]
Definition: globals.c:73
bool stack_is_too_deep(void)
Definition: postgres.c:3483
void PreventCommandIfParallelMode(const char *cmdname)
Definition: utility.c:426
void InitializeSessionUserIdStandalone(void)
Definition: miscinit.c:797
char * DatabasePath
Definition: globals.c:96
int64 TimestampTz
Definition: timestamp.h:39
bool BackupInProgress(void)
Definition: xlog.c:12253
void SetUserIdAndContext(Oid userid, bool sec_def_context)
Definition: miscinit.c:656
void checkDataDir(void)
Definition: miscinit.c:321
bool has_rolreplication(Oid roleid)
Definition: miscinit.c:676
bool VacuumCostActive
Definition: globals.c:152
size_t get_hash_memory_limit(void)
Definition: nodeHash.c:3401
Oid GetUserId(void)
Definition: miscinit.c:495
bool InSecurityRestrictedOperation(void)
Definition: miscinit.c:627
ProcessingMode Mode
Definition: miscinit.c:60
PGDLLIMPORT volatile sig_atomic_t CheckClientConnectionPending
Definition: globals.c:33
void AddToDataDirLockFile(int target_line, const char *str)
Definition: miscinit.c:1348
Definition: libpq-be.h:125
bool superuser_arg(Oid roleid)
Definition: superuser.c:56
PGDLLIMPORT Oid MyDatabaseTableSpace
Definition: globals.c:90
void process_session_preload_libraries(void)
Definition: miscinit.c:1689
BackendType MyBackendType
Definition: miscinit.c:62
PGDLLIMPORT int maintenance_work_mem
Definition: globals.c:126
PGDLLIMPORT volatile sig_atomic_t ClientConnectionLost
Definition: globals.c:34
unsigned int Oid
Definition: postgres_ext.h:31
PGDLLIMPORT char * DataDir
Definition: globals.c:65
void InitializeMaxBackends(void)
Definition: postinit.c:489
PGDLLIMPORT struct Latch * MyLatch
Definition: globals.c:57
void PreventCommandIfReadOnly(const char *cmdname)
Definition: utility.c:408
void SetDatabasePath(const char *path)
Definition: miscinit.c:308
bool InLocalUserIdChange(void)
Definition: miscinit.c:618
#define PGDLLIMPORT
Definition: c.h:1317
char * shared_preload_libraries_string
Definition: miscinit.c:1611
signed int int32
Definition: c.h:429
const char * GetBackendTypeDesc(BackendType backendType)
Definition: miscinit.c:249
Oid GetOuterUserId(void)
Definition: miscinit.c:506
PGDLLIMPORT int MyProcPid
Definition: globals.c:43
AuxProcType MyAuxProcType
Definition: auxprocess.c:45
bool InNoForceRLSOperation(void)
Definition: miscinit.c:636
Oid GetAuthenticatedUserId(void)
Definition: miscinit.c:554
PGDLLIMPORT bool ExitOnAnyError
Definition: globals.c:116
void process_shared_preload_libraries(void)
Definition: miscinit.c:1676
int VacuumCostPageHit
Definition: globals.c:141
PGDLLIMPORT bool IsBackgroundWorker
Definition: globals.c:114
void CreateSocketLockFile(const char *socketfile, bool amPostmaster, const char *socketDir)
Definition: miscinit.c:1301
int trace_recovery_messages
Definition: guc.c:606
char * local_preload_libraries_string
Definition: miscinit.c:1612
int VacuumCostLimit
Definition: globals.c:144
char pkglib_path[]
Definition: globals.c:76
Definition: latch.h:110
int64 VacuumPageDirty
Definition: globals.c:149
bool enableFsync
Definition: globals.c:122
PGDLLIMPORT struct Port * MyProcPort
Definition: globals.c:46
PGDLLIMPORT int NBuffers
Definition: globals.c:135
PGDLLIMPORT pg_time_t MyStartTime
Definition: globals.c:44
PGDLLIMPORT TimestampTz MyStartTimestamp
Definition: globals.c:45
void check_stack_depth(void)
Definition: postgres.c:3469
char * session_preload_libraries_string
Definition: miscinit.c:1610
void InitStandaloneProcess(const char *argv0)
Definition: miscinit.c:175
unsigned int uint32
Definition: c.h:441
void SwitchBackToLocalLatch(void)
Definition: miscinit.c:234
bool superuser(void)
Definition: superuser.c:46
void ValidatePgVersion(const char *path)
Definition: miscinit.c:1547
PGDLLIMPORT volatile uint32 QueryCancelHoldoffCount
Definition: globals.c:40
PGDLLIMPORT volatile uint32 InterruptHoldoffCount
Definition: globals.c:39
void GetUserIdAndContext(Oid *userid, bool *sec_def_context)
Definition: miscinit.c:649
Oid GetSessionUserId(void)
Definition: miscinit.c:529
const char * username
Definition: pgbench.c:282
PGDLLIMPORT int data_directory_mode
Definition: globals.c:71
int64 VacuumPageMiss
Definition: globals.c:148
void pg_bindtextdomain(const char *domain)
Definition: miscinit.c:1700
void SwitchToSharedLatch(void)
Definition: miscinit.c:214
void TouchSocketLockFiles(void)
Definition: miscinit.c:1319
void SetDataDir(const char *dir)
Definition: miscinit.c:414
void SetCurrentRoleId(Oid roleid, bool is_superuser)
Definition: miscinit.c:875
void CancelBackup(void)
Definition: xlog.c:12273
pg_stack_base_t set_stack_base(void)
Definition: postgres.c:3416
void pg_split_opts(char **argv, int *argcp, const char *optstr)
Definition: postinit.c:430
void SetSessionAuthorization(Oid userid, bool is_superuser)
Definition: miscinit.c:829
int trace_recovery(int trace_level)
Definition: elog.c:3597
PGDLLIMPORT volatile sig_atomic_t ProcSignalBarrierPending
Definition: globals.c:37
void restore_stack_base(pg_stack_base_t base)
Definition: postgres.c:3447
PGDLLIMPORT bool IsBinaryUpgrade
Definition: globals.c:113
void CreateDataDirLockFile(bool amPostmaster)
Definition: miscinit.c:1292
int VacuumCostBalance
Definition: globals.c:151
PGDLLIMPORT bool allowSystemTableMods
Definition: globals.c:123
PGDLLIMPORT pid_t PostmasterPid
Definition: globals.c:98
int32 MyCancelKey
Definition: globals.c:47
char * GetUserNameFromId(Oid roleid, bool noerr)
Definition: miscinit.c:910
PGDLLIMPORT volatile sig_atomic_t IdleInTransactionSessionTimeoutPending
Definition: globals.c:35
PGDLLIMPORT bool IsUnderPostmaster
Definition: globals.c:112
void InitializeSessionUserId(const char *rolename, Oid useroid)
Definition: miscinit.c:694
PGDLLIMPORT int DateStyle
Definition: globals.c:118
void ChangeToDataDir(void)
Definition: miscinit.c:435
void GetUserIdAndSecContext(Oid *userid, int *sec_context)
Definition: miscinit.c:600
PGDLLIMPORT int work_mem
Definition: globals.c:124
ProcessingMode
Definition: miscadmin.h:397
PGDLLIMPORT volatile uint32 CritSectionCount
Definition: globals.c:41
static bool is_superuser(Archive *fout)
Definition: pg_dump.c:4263
bool RecheckDataDirLockFile(void)
Definition: miscinit.c:1475
char * stack_base_ptr
Definition: postgres.c:135
void ProcessInterrupts(void)
Definition: postgres.c:3129
int VacuumCostPageMiss
Definition: globals.c:142
PGDLLIMPORT char my_exec_path[]
Definition: globals.c:75
void BaseInit(void)
Definition: postinit.c:511
PGDLLIMPORT Oid MyDatabaseId
Definition: globals.c:88
PGDLLIMPORT int MaxConnections
Definition: globals.c:136
PGDLLIMPORT double hash_mem_multiplier
Definition: globals.c:125
PGDLLIMPORT int max_parallel_workers
Definition: globals.c:138
PGDLLIMPORT bool process_shared_preload_libraries_in_progress
Definition: miscinit.c:1615
BackendType
Definition: miscadmin.h:323
int MyPMChildSlot
Definition: globals.c:48
double VacuumCostDelay
Definition: globals.c:145
PGDLLIMPORT int MaxBackends
Definition: globals.c:139
void InitPostgres(const char *in_dbname, Oid dboid, const char *username, Oid useroid, char *out_dbname, bool override_allow_connections)
Definition: postinit.c:572
void PreventCommandDuringRecovery(const char *cmdname)
Definition: utility.c:445
bool IgnoreSystemIndexes
Definition: miscinit.c:79
PGDLLIMPORT int max_parallel_maintenance_workers
Definition: globals.c:127
PGDLLIMPORT volatile sig_atomic_t ProcDiePending
Definition: globals.c:32
Oid GetCurrentRoleId(void)
Definition: miscinit.c:854
char * pg_stack_base_t
Definition: miscadmin.h:288
void InitPostmasterChild(void)
Definition: miscinit.c:94
int64 VacuumPageHit
Definition: globals.c:147
PGDLLIMPORT volatile sig_atomic_t IdleSessionTimeoutPending
Definition: globals.c:36
PGDLLIMPORT int DateOrder
Definition: globals.c:119