PostgreSQL Source Code  git master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
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-2017, 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 "pgtime.h" /* for pg_time_t */
29 
30 
31 #define PG_BACKEND_VERSIONSTR "postgres (PostgreSQL) " PG_VERSION "\n"
32 
33 #define InvalidPid (-1)
34 
35 
36 /*****************************************************************************
37  * System interrupt and critical section handling
38  *
39  * There are two types of interrupts that a running backend needs to accept
40  * without messing up its state: QueryCancel (SIGINT) and ProcDie (SIGTERM).
41  * In both cases, we need to be able to clean up the current transaction
42  * gracefully, so we can't respond to the interrupt instantaneously ---
43  * there's no guarantee that internal data structures would be self-consistent
44  * if the code is interrupted at an arbitrary instant. Instead, the signal
45  * handlers set flags that are checked periodically during execution.
46  *
47  * The CHECK_FOR_INTERRUPTS() macro is called at strategically located spots
48  * where it is normally safe to accept a cancel or die interrupt. In some
49  * cases, we invoke CHECK_FOR_INTERRUPTS() inside low-level subroutines that
50  * might sometimes be called in contexts that do *not* want to allow a cancel
51  * or die interrupt. The HOLD_INTERRUPTS() and RESUME_INTERRUPTS() macros
52  * allow code to ensure that no cancel or die interrupt will be accepted,
53  * even if CHECK_FOR_INTERRUPTS() gets called in a subroutine. The interrupt
54  * will be held off until CHECK_FOR_INTERRUPTS() is done outside any
55  * HOLD_INTERRUPTS() ... RESUME_INTERRUPTS() section.
56  *
57  * There is also a mechanism to prevent query cancel interrupts, while still
58  * allowing die interrupts: HOLD_CANCEL_INTERRUPTS() and
59  * RESUME_CANCEL_INTERRUPTS().
60  *
61  * Special mechanisms are used to let an interrupt be accepted when we are
62  * waiting for a lock or when we are waiting for command input (but, of
63  * course, only if the interrupt holdoff counter is zero). See the
64  * related code for details.
65  *
66  * A lost connection is handled similarly, although the loss of connection
67  * does not raise a signal, but is detected when we fail to write to the
68  * socket. If there was a signal for a broken connection, we could make use of
69  * it by setting ClientConnectionLost in the signal handler.
70  *
71  * A related, but conceptually distinct, mechanism is the "critical section"
72  * mechanism. A critical section not only holds off cancel/die interrupts,
73  * but causes any ereport(ERROR) or ereport(FATAL) to become ereport(PANIC)
74  * --- that is, a system-wide reset is forced. Needless to say, only really
75  * *critical* code should be marked as a critical section! Currently, this
76  * mechanism is only used for XLOG-related code.
77  *
78  *****************************************************************************/
79 
80 /* in globals.c */
81 /* these are marked volatile because they are set by signal handlers: */
82 extern PGDLLIMPORT volatile bool InterruptPending;
83 extern PGDLLIMPORT volatile bool QueryCancelPending;
84 extern PGDLLIMPORT volatile bool ProcDiePending;
86 extern PGDLLIMPORT volatile sig_atomic_t ConfigReloadPending;
87 
88 extern volatile bool 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 (InterruptPending) \
103  ProcessInterrupts(); \
104 } while(0)
105 #else /* WIN32 */
106 
107 #define CHECK_FOR_INTERRUPTS() \
108 do { \
109  if (UNBLOCKED_SIGNAL_QUEUE()) \
110  pgwin32_dispatch_queued_signals(); \
111  if (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 bool ExitOnAnyError;
156 
157 extern PGDLLIMPORT char *DataDir;
158 
159 extern PGDLLIMPORT int NBuffers;
160 extern int MaxBackends;
161 extern int MaxConnections;
162 extern int max_worker_processes;
163 extern int max_parallel_workers;
164 
165 extern PGDLLIMPORT int MyProcPid;
167 extern PGDLLIMPORT struct Port *MyProcPort;
168 extern PGDLLIMPORT struct Latch *MyLatch;
169 extern int32 MyCancelKey;
170 extern int MyPMChildSlot;
171 
172 extern char OutputFileName[];
173 extern PGDLLIMPORT char my_exec_path[];
174 extern char pkglib_path[];
175 
176 #ifdef EXEC_BACKEND
177 extern char postgres_exec_path[];
178 #endif
179 
180 /*
181  * done in storage/backendid.h for now.
182  *
183  * extern BackendId MyBackendId;
184  */
186 
188 
189 /*
190  * Date/Time Configuration
191  *
192  * DateStyle defines the output formatting choice for date/time types:
193  * USE_POSTGRES_DATES specifies traditional Postgres format
194  * USE_ISO_DATES specifies ISO-compliant format
195  * USE_SQL_DATES specifies Oracle/Ingres-compliant format
196  * USE_GERMAN_DATES specifies German-style dd.mm/yyyy
197  *
198  * DateOrder defines the field order to be assumed when reading an
199  * ambiguous date (anything not in YYYY-MM-DD format, with a four-digit
200  * year field first, is taken to be ambiguous):
201  * DATEORDER_YMD specifies field order yy-mm-dd
202  * DATEORDER_DMY specifies field order dd-mm-yy ("European" convention)
203  * DATEORDER_MDY specifies field order mm-dd-yy ("US" convention)
204  *
205  * In the Postgres and SQL DateStyles, DateOrder also selects output field
206  * order: day comes before month in DMY style, else month comes before day.
207  *
208  * The user-visible "DateStyle" run-time parameter subsumes both of these.
209  */
210 
211 /* valid DateStyle values */
212 #define USE_POSTGRES_DATES 0
213 #define USE_ISO_DATES 1
214 #define USE_SQL_DATES 2
215 #define USE_GERMAN_DATES 3
216 #define USE_XSD_DATES 4
217 
218 /* valid DateOrder values */
219 #define DATEORDER_YMD 0
220 #define DATEORDER_DMY 1
221 #define DATEORDER_MDY 2
222 
223 extern PGDLLIMPORT int DateStyle;
224 extern PGDLLIMPORT int DateOrder;
225 
226 /*
227  * IntervalStyles
228  * INTSTYLE_POSTGRES Like Postgres < 8.4 when DateStyle = 'iso'
229  * INTSTYLE_POSTGRES_VERBOSE Like Postgres < 8.4 when DateStyle != 'iso'
230  * INTSTYLE_SQL_STANDARD SQL standard interval literals
231  * INTSTYLE_ISO_8601 ISO-8601-basic formatted intervals
232  */
233 #define INTSTYLE_POSTGRES 0
234 #define INTSTYLE_POSTGRES_VERBOSE 1
235 #define INTSTYLE_SQL_STANDARD 2
236 #define INTSTYLE_ISO_8601 3
237 
238 extern PGDLLIMPORT int IntervalStyle;
239 
240 #define MAXTZLEN 10 /* max TZ name len, not counting tr. null */
241 
242 extern bool enableFsync;
243 extern bool allowSystemTableMods;
244 extern PGDLLIMPORT int work_mem;
247 
248 extern int VacuumCostPageHit;
249 extern int VacuumCostPageMiss;
250 extern int VacuumCostPageDirty;
251 extern int VacuumCostLimit;
252 extern int VacuumCostDelay;
253 
254 extern int VacuumPageHit;
255 extern int VacuumPageMiss;
256 extern int VacuumPageDirty;
257 
258 extern int VacuumCostBalance;
259 extern bool VacuumCostActive;
260 
261 
262 /* in tcop/postgres.c */
263 
264 #if defined(__ia64__) || defined(__ia64)
265 typedef struct
266 {
267  char *stack_base_ptr;
268  char *register_stack_base_ptr;
270 #else
271 typedef char *pg_stack_base_t;
272 #endif
273 
274 extern pg_stack_base_t set_stack_base(void);
275 extern void restore_stack_base(pg_stack_base_t base);
276 extern void check_stack_depth(void);
277 extern bool stack_is_too_deep(void);
278 
280 
281 /* in tcop/utility.c */
282 extern void PreventCommandIfReadOnly(const char *cmdname);
283 extern void PreventCommandIfParallelMode(const char *cmdname);
284 extern void PreventCommandDuringRecovery(const char *cmdname);
285 
286 /* in utils/misc/guc.c */
287 extern int trace_recovery_messages;
288 extern int trace_recovery(int trace_level);
289 
290 /*****************************************************************************
291  * pdir.h -- *
292  * POSTGRES directory path definitions. *
293  *****************************************************************************/
294 
295 /* flags to be OR'd to form sec_context */
296 #define SECURITY_LOCAL_USERID_CHANGE 0x0001
297 #define SECURITY_RESTRICTED_OPERATION 0x0002
298 #define SECURITY_NOFORCE_RLS 0x0004
299 
300 extern char *DatabasePath;
301 
302 /* now in utils/init/miscinit.c */
303 extern void InitPostmasterChild(void);
304 extern void InitStandaloneProcess(const char *argv0);
305 
306 extern void SetDatabasePath(const char *path);
307 
308 extern char *GetUserNameFromId(Oid roleid, bool noerr);
309 extern Oid GetUserId(void);
310 extern Oid GetOuterUserId(void);
311 extern Oid GetSessionUserId(void);
312 extern Oid GetAuthenticatedUserId(void);
313 extern void GetUserIdAndSecContext(Oid *userid, int *sec_context);
314 extern void SetUserIdAndSecContext(Oid userid, int sec_context);
315 extern bool InLocalUserIdChange(void);
316 extern bool InSecurityRestrictedOperation(void);
317 extern bool InNoForceRLSOperation(void);
318 extern void GetUserIdAndContext(Oid *userid, bool *sec_def_context);
319 extern void SetUserIdAndContext(Oid userid, bool sec_def_context);
320 extern void InitializeSessionUserId(const char *rolename, Oid useroid);
321 extern void InitializeSessionUserIdStandalone(void);
322 extern void SetSessionAuthorization(Oid userid, bool is_superuser);
323 extern Oid GetCurrentRoleId(void);
324 extern void SetCurrentRoleId(Oid roleid, bool is_superuser);
325 
326 extern void SetDataDir(const char *dir);
327 extern void ChangeToDataDir(void);
328 
329 extern void SwitchToSharedLatch(void);
330 extern void SwitchBackToLocalLatch(void);
331 
332 /* in utils/misc/superuser.c */
333 extern bool superuser(void); /* current user is superuser */
334 extern bool superuser_arg(Oid roleid); /* given user is superuser */
335 
336 
337 /*****************************************************************************
338  * pmod.h -- *
339  * POSTGRES processing mode definitions. *
340  *****************************************************************************/
341 
342 /*
343  * Description:
344  * There are three processing modes in POSTGRES. They are
345  * BootstrapProcessing or "bootstrap," InitProcessing or
346  * "initialization," and NormalProcessing or "normal."
347  *
348  * The first two processing modes are used during special times. When the
349  * system state indicates bootstrap processing, transactions are all given
350  * transaction id "one" and are consequently guaranteed to commit. This mode
351  * is used during the initial generation of template databases.
352  *
353  * Initialization mode: used while starting a backend, until all normal
354  * initialization is complete. Some code behaves differently when executed
355  * in this mode to enable system bootstrapping.
356  *
357  * If a POSTGRES backend process is in normal mode, then all code may be
358  * executed normally.
359  */
360 
361 typedef enum ProcessingMode
362 {
363  BootstrapProcessing, /* bootstrap creation of template database */
364  InitProcessing, /* initializing system */
365  NormalProcessing /* normal processing */
367 
368 extern ProcessingMode Mode;
369 
370 #define IsBootstrapProcessingMode() (Mode == BootstrapProcessing)
371 #define IsInitProcessingMode() (Mode == InitProcessing)
372 #define IsNormalProcessingMode() (Mode == NormalProcessing)
373 
374 #define GetProcessingMode() Mode
375 
376 #define SetProcessingMode(mode) \
377  do { \
378  AssertArg((mode) == BootstrapProcessing || \
379  (mode) == InitProcessing || \
380  (mode) == NormalProcessing); \
381  Mode = (mode); \
382  } while(0)
383 
384 
385 /*
386  * Auxiliary-process type identifiers. These used to be in bootstrap.h
387  * but it seems saner to have them here, with the ProcessingMode stuff.
388  * The MyAuxProcType global is defined and set in bootstrap.c.
389  */
390 
391 typedef enum
392 {
401 
402  NUM_AUXPROCTYPES /* Must be last! */
403 } AuxProcType;
404 
406 
407 #define AmBootstrapProcess() (MyAuxProcType == BootstrapProcess)
408 #define AmStartupProcess() (MyAuxProcType == StartupProcess)
409 #define AmBackgroundWriterProcess() (MyAuxProcType == BgWriterProcess)
410 #define AmCheckpointerProcess() (MyAuxProcType == CheckpointerProcess)
411 #define AmWalWriterProcess() (MyAuxProcType == WalWriterProcess)
412 #define AmWalReceiverProcess() (MyAuxProcType == WalReceiverProcess)
413 
414 
415 /*****************************************************************************
416  * pinit.h -- *
417  * POSTGRES initialization and cleanup definitions. *
418  *****************************************************************************/
419 
420 /* in utils/init/postinit.c */
421 extern void pg_split_opts(char **argv, int *argcp, const char *optstr);
422 extern void InitializeMaxBackends(void);
423 extern void InitPostgres(const char *in_dbname, Oid dboid, const char *username,
424  Oid useroid, char *out_dbname);
425 extern void BaseInit(void);
426 
427 /* in utils/init/miscinit.c */
428 extern bool IgnoreSystemIndexes;
432 extern char *local_preload_libraries_string;
433 
434 /*
435  * As of 9.1, the contents of the data-directory lock file are:
436  *
437  * line #
438  * 1 postmaster PID (or negative of a standalone backend's PID)
439  * 2 data directory path
440  * 3 postmaster start timestamp (time_t representation)
441  * 4 port number
442  * 5 first Unix socket directory path (empty if none)
443  * 6 first listen_address (IP address or "*"; empty if no TCP port)
444  * 7 shared memory key (not present on Windows)
445  *
446  * Lines 6 and up are added via AddToDataDirLockFile() after initial file
447  * creation.
448  *
449  * The socket lock file, if used, has the same contents as lines 1-5.
450  */
451 #define LOCK_FILE_LINE_PID 1
452 #define LOCK_FILE_LINE_DATA_DIR 2
453 #define LOCK_FILE_LINE_START_TIME 3
454 #define LOCK_FILE_LINE_PORT 4
455 #define LOCK_FILE_LINE_SOCKET_DIR 5
456 #define LOCK_FILE_LINE_LISTEN_ADDR 6
457 #define LOCK_FILE_LINE_SHMEM_KEY 7
458 
459 extern void CreateDataDirLockFile(bool amPostmaster);
460 extern void CreateSocketLockFile(const char *socketfile, bool amPostmaster,
461  const char *socketDir);
462 extern void TouchSocketLockFiles(void);
463 extern void AddToDataDirLockFile(int target_line, const char *str);
464 extern bool RecheckDataDirLockFile(void);
465 extern void ValidatePgVersion(const char *path);
466 extern void process_shared_preload_libraries(void);
467 extern void process_session_preload_libraries(void);
468 extern void pg_bindtextdomain(const char *domain);
469 extern bool has_rolreplication(Oid roleid);
470 
471 /* in access/transam/xlog.c */
472 extern bool BackupInProgress(void);
473 extern void CancelBackup(void);
474 
475 #endif /* MISCADMIN_H */
AuxProcType
Definition: miscadmin.h:391
PGDLLIMPORT bool IsPostmasterEnvironment
Definition: globals.c:100
PGDLLIMPORT int replacement_sort_tuples
Definition: globals.c:115
PGDLLIMPORT int IntervalStyle
Definition: globals.c:109
void SetUserIdAndSecContext(Oid userid, int sec_context)
Definition: miscinit.c:395
int MaxBackends
Definition: globals.c:127
static char * argv0
Definition: pg_ctl.c:89
int VacuumCostPageDirty
Definition: globals.c:131
int64 pg_time_t
Definition: pgtime.h:23
int VacuumPageHit
Definition: globals.c:135
char OutputFileName[]
Definition: globals.c:62
bool stack_is_too_deep(void)
Definition: postgres.c:3131
PGDLLIMPORT volatile sig_atomic_t ConfigReloadPending
Definition: globals.c:34
void PreventCommandIfParallelMode(const char *cmdname)
Definition: utility.c:254
void InitializeSessionUserIdStandalone(void)
Definition: miscinit.c:578
char * DatabasePath
Definition: globals.c:85
bool BackupInProgress(void)
Definition: xlog.c:11344
void SetUserIdAndContext(Oid userid, bool sec_def_context)
Definition: miscinit.c:444
bool has_rolreplication(Oid roleid)
Definition: miscinit.c:464
bool VacuumCostActive
Definition: globals.c:140
Oid GetUserId(void)
Definition: miscinit.c:283
bool InSecurityRestrictedOperation(void)
Definition: miscinit.c:415
ProcessingMode Mode
Definition: miscinit.c:56
void AddToDataDirLockFile(int target_line, const char *str)
Definition: miscinit.c:1156
Definition: libpq-be.h:116
bool superuser_arg(Oid roleid)
Definition: superuser.c:57
PGDLLIMPORT Oid MyDatabaseTableSpace
Definition: globals.c:79
void process_session_preload_libraries(void)
Definition: miscinit.c:1491
PGDLLIMPORT int maintenance_work_mem
Definition: globals.c:114
PGDLLIMPORT volatile bool ProcDiePending
Definition: globals.c:31
unsigned int Oid
Definition: postgres_ext.h:31
PGDLLIMPORT char * DataDir
Definition: globals.c:60
void InitializeMaxBackends(void)
Definition: postinit.c:495
PGDLLIMPORT struct Latch * MyLatch
Definition: globals.c:52
int max_parallel_workers
Definition: globals.c:126
void PreventCommandIfReadOnly(const char *cmdname)
Definition: utility.c:236
void SetDatabasePath(const char *path)
Definition: miscinit.c:82
bool InLocalUserIdChange(void)
Definition: miscinit.c:406
int VacuumPageDirty
Definition: globals.c:137
#define PGDLLIMPORT
Definition: c.h:1063
char * shared_preload_libraries_string
Definition: miscinit.c:1413
signed int int32
Definition: c.h:256
Oid GetOuterUserId(void)
Definition: miscinit.c:294
PGDLLIMPORT int MyProcPid
Definition: globals.c:39
int VacuumCostDelay
Definition: globals.c:133
AuxProcType MyAuxProcType
Definition: bootstrap.c:68
bool InNoForceRLSOperation(void)
Definition: miscinit.c:424
bool allowSystemTableMods
Definition: globals.c:112
Oid GetAuthenticatedUserId(void)
Definition: miscinit.c:342
void process_shared_preload_libraries(void)
Definition: miscinit.c:1478
int VacuumCostPageHit
Definition: globals.c:129
PGDLLIMPORT bool IsBackgroundWorker
Definition: globals.c:103
void CreateSocketLockFile(const char *socketfile, bool amPostmaster, const char *socketDir)
Definition: miscinit.c:1089
PGDLLIMPORT volatile bool QueryCancelPending
Definition: globals.c:30
int trace_recovery_messages
Definition: guc.c:455
char * local_preload_libraries_string
Definition: miscinit.c:1414
int VacuumCostLimit
Definition: globals.c:132
void InitPostgres(const char *in_dbname, Oid dboid, const char *username, Oid useroid, char *out_dbname)
Definition: postinit.c:558
char pkglib_path[]
Definition: globals.c:65
Definition: latch.h:110
bool enableFsync
Definition: globals.c:111
PGDLLIMPORT struct Port * MyProcPort
Definition: globals.c:41
PGDLLIMPORT int NBuffers
Definition: globals.c:123
PGDLLIMPORT pg_time_t MyStartTime
Definition: globals.c:40
void check_stack_depth(void)
Definition: postgres.c:3117
char * session_preload_libraries_string
Definition: miscinit.c:1412
void InitStandaloneProcess(const char *argv0)
Definition: miscinit.c:219
unsigned int uint32
Definition: c.h:268
void SwitchBackToLocalLatch(void)
Definition: miscinit.c:264
bool superuser(void)
Definition: superuser.c:47
void ValidatePgVersion(const char *path)
Definition: miscinit.c:1349
PGDLLIMPORT volatile uint32 QueryCancelHoldoffCount
Definition: globals.c:36
PGDLLIMPORT volatile uint32 InterruptHoldoffCount
Definition: globals.c:35
void GetUserIdAndContext(Oid *userid, bool *sec_def_context)
Definition: miscinit.c:437
Oid GetSessionUserId(void)
Definition: miscinit.c:317
void pg_bindtextdomain(const char *domain)
Definition: miscinit.c:1502
void SwitchToSharedLatch(void)
Definition: miscinit.c:245
void TouchSocketLockFiles(void)
Definition: miscinit.c:1107
void SetDataDir(const char *dir)
Definition: miscinit.c:94
void SetCurrentRoleId(Oid roleid, bool is_superuser)
Definition: miscinit.c:656
void CancelBackup(void)
Definition: xlog.c:11364
pg_stack_base_t set_stack_base(void)
Definition: postgres.c:3064
PGDLLIMPORT volatile bool InterruptPending
Definition: globals.c:29
void pg_split_opts(char **argv, int *argcp, const char *optstr)
Definition: postinit.c:436
void SetSessionAuthorization(Oid userid, bool is_superuser)
Definition: miscinit.c:610
int trace_recovery(int trace_level)
Definition: elog.c:3753
void restore_stack_base(pg_stack_base_t base)
Definition: postgres.c:3095
PGDLLIMPORT bool IsBinaryUpgrade
Definition: globals.c:102
void CreateDataDirLockFile(bool amPostmaster)
Definition: miscinit.c:1080
static char * username
Definition: initdb.c:131
int VacuumCostBalance
Definition: globals.c:139
PGDLLIMPORT pid_t PostmasterPid
Definition: globals.c:87
bool ExitOnAnyError
Definition: globals.c:105
int32 MyCancelKey
Definition: globals.c:42
char * GetUserNameFromId(Oid roleid, bool noerr)
Definition: miscinit.c:691
#define SIGNAL_ARGS
Definition: c.h:1079
PGDLLIMPORT volatile bool IdleInTransactionSessionTimeoutPending
Definition: globals.c:33
PGDLLIMPORT bool IsUnderPostmaster
Definition: globals.c:101
void InitializeSessionUserId(const char *rolename, Oid useroid)
Definition: miscinit.c:482
PGDLLIMPORT int DateStyle
Definition: globals.c:107
void ChangeToDataDir(void)
Definition: miscinit.c:115
void PostgresSigHupHandler(SIGNAL_ARGS)
Definition: postgres.c:2688
void GetUserIdAndSecContext(Oid *userid, int *sec_context)
Definition: miscinit.c:388
PGDLLIMPORT int work_mem
Definition: globals.c:113
ProcessingMode
Definition: miscadmin.h:361
PGDLLIMPORT volatile uint32 CritSectionCount
Definition: globals.c:37
static bool is_superuser(Archive *fout)
Definition: pg_dump.c:3673
bool RecheckDataDirLockFile(void)
Definition: miscinit.c:1277
volatile bool ClientConnectionLost
Definition: globals.c:32
char * stack_base_ptr
Definition: postgres.c:117
void ProcessInterrupts(void)
Definition: postgres.c:2825
int VacuumCostPageMiss
Definition: globals.c:130
PGDLLIMPORT char my_exec_path[]
Definition: globals.c:64
void BaseInit(void)
Definition: postinit.c:517
PGDLLIMPORT Oid MyDatabaseId
Definition: globals.c:77
int MaxConnections
Definition: globals.c:124
PGDLLIMPORT bool process_shared_preload_libraries_in_progress
Definition: miscinit.c:1417
int VacuumPageMiss
Definition: globals.c:136
int MyPMChildSlot
Definition: globals.c:43
void PreventCommandDuringRecovery(const char *cmdname)
Definition: utility.c:273
int max_worker_processes
Definition: globals.c:125
bool IgnoreSystemIndexes
Definition: miscinit.c:73
Oid GetCurrentRoleId(void)
Definition: miscinit.c:635
char * pg_stack_base_t
Definition: miscadmin.h:271
void InitPostmasterChild(void)
Definition: miscinit.c:175
PGDLLIMPORT int DateOrder
Definition: globals.c:108