PostgreSQL Source Code git master
Loading...
Searching...
No Matches
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-2026, 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: */
93extern PGDLLIMPORT volatile int ProcDieSenderPid;
94extern PGDLLIMPORT volatile int ProcDieSenderUid;
101
104
105/* these are marked volatile because they are examined by signal handlers: */
108extern PGDLLIMPORT volatile uint32 CritSectionCount;
109
110/* in tcop/postgres.c */
111extern void ProcessInterrupts(void);
112
113/* Test whether an interrupt is pending */
114#ifndef WIN32
115#define INTERRUPTS_PENDING_CONDITION() \
116 (unlikely(InterruptPending))
117#else
118#define INTERRUPTS_PENDING_CONDITION() \
119 (unlikely(UNBLOCKED_SIGNAL_QUEUE()) ? \
120 pgwin32_dispatch_queued_signals() : (void) 0, \
121 unlikely(InterruptPending))
122#endif
123
124/* Service interrupt, if one is pending and it's safe to service it now */
125#define CHECK_FOR_INTERRUPTS() \
126do { \
127 if (INTERRUPTS_PENDING_CONDITION()) \
128 ProcessInterrupts(); \
129} while(0)
130
131/* Is ProcessInterrupts() guaranteed to clear InterruptPending? */
132#define INTERRUPTS_CAN_BE_PROCESSED() \
133 (InterruptHoldoffCount == 0 && CritSectionCount == 0 && \
134 QueryCancelHoldoffCount == 0)
135
136#define HOLD_INTERRUPTS() (InterruptHoldoffCount++)
137
138#define RESUME_INTERRUPTS() \
139do { \
140 Assert(InterruptHoldoffCount > 0); \
141 InterruptHoldoffCount--; \
142} while(0)
143
144#define HOLD_CANCEL_INTERRUPTS() (QueryCancelHoldoffCount++)
145
146#define RESUME_CANCEL_INTERRUPTS() \
147do { \
148 Assert(QueryCancelHoldoffCount > 0); \
149 QueryCancelHoldoffCount--; \
150} while(0)
151
152#define START_CRIT_SECTION() (CritSectionCount++)
153
154#define END_CRIT_SECTION() \
155do { \
156 Assert(CritSectionCount > 0); \
157 CritSectionCount--; \
158} while(0)
159
160
161/*****************************************************************************
162 * globals.h -- *
163 *****************************************************************************/
164
165/*
166 * from utils/init/globals.c
167 */
171extern PGDLLIMPORT bool IsBinaryUpgrade;
172
173extern PGDLLIMPORT bool ExitOnAnyError;
174
175extern PGDLLIMPORT char *DataDir;
177
178extern PGDLLIMPORT int NBuffers;
179extern PGDLLIMPORT int MaxBackends;
180extern PGDLLIMPORT int MaxConnections;
184
188extern PGDLLIMPORT int notify_buffers;
192
193extern PGDLLIMPORT int MyProcPid;
196extern PGDLLIMPORT struct Port *MyProcPort;
197extern PGDLLIMPORT struct Latch *MyLatch;
200extern PGDLLIMPORT int MyPMChildSlot;
201
202extern PGDLLIMPORT char OutputFileName[];
203extern PGDLLIMPORT char my_exec_path[];
204extern PGDLLIMPORT char pkglib_path[];
205
206#ifdef EXEC_BACKEND
207extern PGDLLIMPORT char postgres_exec_path[];
208#endif
209
211
213
215
216/*
217 * Date/Time Configuration
218 *
219 * DateStyle defines the output formatting choice for date/time types:
220 * USE_POSTGRES_DATES specifies traditional Postgres format
221 * USE_ISO_DATES specifies ISO-compliant format
222 * USE_SQL_DATES specifies Oracle/Ingres-compliant format
223 * USE_GERMAN_DATES specifies German-style dd.mm/yyyy
224 *
225 * DateOrder defines the field order to be assumed when reading an
226 * ambiguous date (anything not in YYYY-MM-DD format, with a four-digit
227 * year field first, is taken to be ambiguous):
228 * DATEORDER_YMD specifies field order yy-mm-dd
229 * DATEORDER_DMY specifies field order dd-mm-yy ("European" convention)
230 * DATEORDER_MDY specifies field order mm-dd-yy ("US" convention)
231 *
232 * In the Postgres and SQL DateStyles, DateOrder also selects output field
233 * order: day comes before month in DMY style, else month comes before day.
234 *
235 * The user-visible "DateStyle" run-time parameter subsumes both of these.
236 */
237
238/* valid DateStyle values */
239#define USE_POSTGRES_DATES 0
240#define USE_ISO_DATES 1
241#define USE_SQL_DATES 2
242#define USE_GERMAN_DATES 3
243#define USE_XSD_DATES 4
244
245/* valid DateOrder values */
246#define DATEORDER_YMD 0
247#define DATEORDER_DMY 1
248#define DATEORDER_MDY 2
249
250extern PGDLLIMPORT int DateStyle;
251extern PGDLLIMPORT int DateOrder;
252
253/*
254 * IntervalStyles
255 * INTSTYLE_POSTGRES Like Postgres < 8.4 when DateStyle = 'iso'
256 * INTSTYLE_POSTGRES_VERBOSE Like Postgres < 8.4 when DateStyle != 'iso'
257 * INTSTYLE_SQL_STANDARD SQL standard interval literals
258 * INTSTYLE_ISO_8601 ISO-8601-basic formatted intervals
259 */
260#define INTSTYLE_POSTGRES 0
261#define INTSTYLE_POSTGRES_VERBOSE 1
262#define INTSTYLE_SQL_STANDARD 2
263#define INTSTYLE_ISO_8601 3
264
265extern PGDLLIMPORT int IntervalStyle;
266
267#define MAXTZLEN 10 /* max TZ name len, not counting tr. null */
268
269extern PGDLLIMPORT bool enableFsync;
271extern PGDLLIMPORT int work_mem;
272extern PGDLLIMPORT double hash_mem_multiplier;
275
276/*
277 * Upper and lower hard limits for the buffer access strategy ring size
278 * specified by the VacuumBufferUsageLimit GUC and BUFFER_USAGE_LIMIT option
279 * to VACUUM and ANALYZE.
280 */
281#define MIN_BAS_VAC_RING_SIZE_KB 128
282#define MAX_BAS_VAC_RING_SIZE_KB (16 * 1024 * 1024)
283
289extern PGDLLIMPORT double VacuumCostDelay;
290
292extern PGDLLIMPORT bool VacuumCostActive;
293
294
295/* in utils/misc/stack_depth.c */
296
298
299/* Required daylight between max_stack_depth and the kernel limit, in bytes */
300#define STACK_DEPTH_SLOP (512 * 1024)
301
302typedef char *pg_stack_base_t;
303
305extern void restore_stack_base(pg_stack_base_t base);
306extern void check_stack_depth(void);
307extern bool stack_is_too_deep(void);
309
310/* in tcop/utility.c */
311extern void PreventCommandIfReadOnly(const char *cmdname);
312extern void PreventCommandIfParallelMode(const char *cmdname);
313extern void PreventCommandDuringRecovery(const char *cmdname);
314
315/* in replication/snapbuild.c */
316
317/*
318 * Keep track of whether logical decoding in this backend promised not to
319 * access shared catalogs, as a safety check. This is checked by genam.c when
320 * a catalog scan takes place to verify that no shared catalogs are accessed.
321 */
323
324/*****************************************************************************
325 * pdir.h -- *
326 * POSTGRES directory path definitions. *
327 *****************************************************************************/
328
329/* flags to be OR'd to form sec_context */
330#define SECURITY_LOCAL_USERID_CHANGE 0x0001
331#define SECURITY_RESTRICTED_OPERATION 0x0002
332#define SECURITY_NOFORCE_RLS 0x0004
333
334extern PGDLLIMPORT char *DatabasePath;
335
336/* now in utils/init/miscinit.c */
337extern void InitPostmasterChild(void);
338extern void InitStandaloneProcess(const char *argv0);
339extern void InitProcessLocalLatch(void);
340extern void SwitchToSharedLatch(void);
341extern void SwitchBackToLocalLatch(void);
342
343/*
344 * MyBackendType indicates what kind of a backend this is.
345 *
346 * If you add entries, please also update the child_process_kinds array in
347 * launch_backend.c.
348 */
349typedef enum BackendType
350{
352
353 /* Backends and other backend-like processes */
361
363
364 /*
365 * Auxiliary processes. These have PGPROC entries, but they are not
366 * attached to any particular database, and cannot run transactions or
367 * even take heavyweight locks. There can be only one of each of these
368 * running at a time, except for IO workers.
369 *
370 * If you modify these, make sure to update NUM_AUXILIARY_PROCS and the
371 * glossary in the docs.
372 */
381
384
385 /*
386 * Logger is not connected to shared memory and does not have a PGPROC
387 * entry.
388 */
391
392#define BACKEND_NUM_TYPES (B_LOGGER + 1)
393
395
396#define AmRegularBackendProcess() (MyBackendType == B_BACKEND)
397#define AmAutoVacuumLauncherProcess() (MyBackendType == B_AUTOVAC_LAUNCHER)
398#define AmAutoVacuumWorkerProcess() (MyBackendType == B_AUTOVAC_WORKER)
399#define AmBackgroundWorkerProcess() (MyBackendType == B_BG_WORKER)
400#define AmWalSenderProcess() (MyBackendType == B_WAL_SENDER)
401#define AmLogicalSlotSyncWorkerProcess() (MyBackendType == B_SLOTSYNC_WORKER)
402#define AmArchiverProcess() (MyBackendType == B_ARCHIVER)
403#define AmBackgroundWriterProcess() (MyBackendType == B_BG_WRITER)
404#define AmCheckpointerProcess() (MyBackendType == B_CHECKPOINTER)
405#define AmStartupProcess() (MyBackendType == B_STARTUP)
406#define AmWalReceiverProcess() (MyBackendType == B_WAL_RECEIVER)
407#define AmWalSummarizerProcess() (MyBackendType == B_WAL_SUMMARIZER)
408#define AmWalWriterProcess() (MyBackendType == B_WAL_WRITER)
409#define AmIoWorkerProcess() (MyBackendType == B_IO_WORKER)
410#define AmDataChecksumsWorkerProcess() \
411 (MyBackendType == B_DATACHECKSUMSWORKER_LAUNCHER || \
412 MyBackendType == B_DATACHECKSUMSWORKER_WORKER)
413
414#define AmSpecialWorkerProcess() \
415 (AmAutoVacuumLauncherProcess() || \
416 AmLogicalSlotSyncWorkerProcess())
417
418/*
419 * Backend types that are spawned by the postmaster to serve a client or
420 * replication connection. These backend types have in common that they are
421 * externally initiated.
422 */
423#define IsExternalConnectionBackend(backend_type) \
424 (backend_type == B_BACKEND || backend_type == B_WAL_SENDER)
425
426extern const char *GetBackendTypeDesc(BackendType backendType);
427
428extern void SetDatabasePath(const char *path);
429extern void checkDataDir(void);
430extern void SetDataDir(const char *dir);
431extern void ChangeToDataDir(void);
432
433extern char *GetUserNameFromId(Oid roleid, bool noerr);
434extern Oid GetUserId(void);
435extern Oid GetOuterUserId(void);
436extern Oid GetSessionUserId(void);
437extern bool GetSessionUserIsSuperuser(void);
438extern Oid GetAuthenticatedUserId(void);
439extern void SetAuthenticatedUserId(Oid userid);
440extern void GetUserIdAndSecContext(Oid *userid, int *sec_context);
441extern void SetUserIdAndSecContext(Oid userid, int sec_context);
442extern bool InLocalUserIdChange(void);
443extern bool InSecurityRestrictedOperation(void);
444extern bool InNoForceRLSOperation(void);
445extern void GetUserIdAndContext(Oid *userid, bool *sec_def_context);
446extern void SetUserIdAndContext(Oid userid, bool sec_def_context);
447extern void InitializeSessionUserId(const char *rolename, Oid roleid,
448 bool bypass_login_check);
449extern void InitializeSessionUserIdStandalone(void);
450extern void SetSessionAuthorization(Oid userid, bool is_superuser);
451extern Oid GetCurrentRoleId(void);
452extern void SetCurrentRoleId(Oid roleid, bool is_superuser);
453extern void InitializeSystemUser(const char *authn_id,
454 const char *auth_method);
455extern const char *GetSystemUser(void);
456
457/* in utils/misc/superuser.c */
458extern bool superuser(void); /* current user is superuser */
459extern bool superuser_arg(Oid roleid); /* given user is superuser */
460
461
462/*****************************************************************************
463 * pmod.h -- *
464 * POSTGRES processing mode definitions. *
465 *****************************************************************************/
466
467/*
468 * Description:
469 * There are three processing modes in POSTGRES. They are
470 * BootstrapProcessing or "bootstrap," InitProcessing or
471 * "initialization," and NormalProcessing or "normal."
472 *
473 * The first two processing modes are used during special times. When the
474 * system state indicates bootstrap processing, transactions are all given
475 * transaction id "one" and are consequently guaranteed to commit. This mode
476 * is used during the initial generation of template databases.
477 *
478 * Initialization mode: used while starting a backend, until all normal
479 * initialization is complete. Some code behaves differently when executed
480 * in this mode to enable system bootstrapping.
481 *
482 * If a POSTGRES backend process is in normal mode, then all code may be
483 * executed normally.
484 */
485
486typedef enum ProcessingMode
487{
488 BootstrapProcessing, /* bootstrap creation of template database */
489 InitProcessing, /* initializing system */
490 NormalProcessing, /* normal processing */
492
494
495#define IsBootstrapProcessingMode() (Mode == BootstrapProcessing)
496#define IsInitProcessingMode() (Mode == InitProcessing)
497#define IsNormalProcessingMode() (Mode == NormalProcessing)
498
499#define GetProcessingMode() Mode
500
501#define SetProcessingMode(mode) \
502 do { \
503 Assert((mode) == BootstrapProcessing || \
504 (mode) == InitProcessing || \
505 (mode) == NormalProcessing); \
506 Mode = (mode); \
507 } while(0)
508
509
510/*****************************************************************************
511 * pinit.h -- *
512 * POSTGRES initialization and cleanup definitions. *
513 *****************************************************************************/
514
515/* in utils/init/postinit.c */
516/* flags for InitPostgres() */
517#define INIT_PG_LOAD_SESSION_LIBS 0x0001
518#define INIT_PG_OVERRIDE_ALLOW_CONNS 0x0002
519#define INIT_PG_OVERRIDE_ROLE_LOGIN 0x0004
520extern void pg_split_opts(char **argv, int *argcp, const char *optstr);
521extern void InitializeMaxBackends(void);
522extern void InitializeFastPathLocks(void);
523extern void InitPostgres(const char *in_dbname, Oid dboid,
524 const char *username, Oid useroid,
525 uint32 flags,
526 char *out_dbname);
527extern void BaseInit(void);
528extern void StoreConnectionWarning(char *msg, char *detail);
529
530/* in utils/init/miscinit.c */
538
539extern void CreateDataDirLockFile(bool amPostmaster);
540extern void CreateSocketLockFile(const char *socketfile, bool amPostmaster,
541 const char *socketDir);
542extern void TouchSocketLockFiles(void);
543extern void AddToDataDirLockFile(int target_line, const char *str);
544extern bool RecheckDataDirLockFile(void);
545extern void ValidatePgVersion(const char *path);
546extern void process_shared_preload_libraries(void);
547extern void process_session_preload_libraries(void);
548extern void process_shmem_requests(void);
549extern void pg_bindtextdomain(const char *domain);
550extern bool has_rolreplication(Oid roleid);
551
554
557extern void RestoreClientConnectionInfo(char *conninfo);
558
559/* in executor/nodeHash.c */
560extern size_t get_hash_memory_limit(void);
561
562#endif /* MISCADMIN_H */
bool is_superuser(void)
Definition common.c:2480
#define PGDLLIMPORT
Definition c.h:1421
uint8_t uint8
Definition c.h:622
uint32_t uint32
Definition c.h:624
size_t Size
Definition c.h:689
int64 TimestampTz
Definition timestamp.h:39
const char * str
static char * username
Definition initdb.c:153
PGDLLIMPORT int IntervalStyle
Definition globals.c:129
PGDLLIMPORT shmem_request_hook_type shmem_request_hook
Definition miscinit.c:1791
PGDLLIMPORT double VacuumCostDelay
Definition globals.c:158
void ChangeToDataDir(void)
Definition miscinit.c:410
PGDLLIMPORT uint8 MyCancelKey[]
Definition globals.c:54
PGDLLIMPORT bool IsPostmasterEnvironment
Definition globals.c:121
Oid GetOuterUserId(void)
Definition miscinit.c:481
void process_shmem_requests(void)
Definition miscinit.c:1881
PGDLLIMPORT struct Port * MyProcPort
Definition globals.c:53
void restore_stack_base(pg_stack_base_t base)
Definition stack_depth.c:77
void InitializeMaxBackends(void)
Definition postinit.c:559
void PreventCommandIfReadOnly(const char *cmdname)
Definition utility.c:409
PGDLLIMPORT volatile uint32 InterruptHoldoffCount
Definition globals.c:43
ProcessingMode
Definition miscadmin.h:487
@ NormalProcessing
Definition miscadmin.h:490
@ InitProcessing
Definition miscadmin.h:489
@ BootstrapProcessing
Definition miscadmin.h:488
PGDLLIMPORT volatile int ProcDieSenderPid
Definition globals.c:46
void pg_split_opts(char **argv, int *argcp, const char *optstr)
Definition postinit.c:501
void InitializeSessionUserId(const char *rolename, Oid roleid, bool bypass_login_check)
Definition miscinit.c:711
void InitStandaloneProcess(const char *argv0)
Definition miscinit.c:176
void SerializeClientConnectionInfo(Size maxsize, char *start_address)
Definition miscinit.c:1053
void PreventCommandIfParallelMode(const char *cmdname)
Definition utility.c:427
PGDLLIMPORT int commit_timestamp_buffers
Definition globals.c:164
PGDLLIMPORT bool IsUnderPostmaster
Definition globals.c:122
void InitializeSystemUser(const char *authn_id, const char *auth_method)
Definition miscinit.c:876
PGDLLIMPORT int VacuumCostBalance
Definition globals.c:160
PGDLLIMPORT Oid MyDatabaseTableSpace
Definition globals.c:98
void InitializeSessionUserIdStandalone(void)
Definition miscinit.c:841
ssize_t get_stack_depth_rlimit(void)
void AddToDataDirLockFile(int target_line, const char *str)
Definition miscinit.c:1521
void InitProcessLocalLatch(void)
Definition miscinit.c:236
void BaseInit(void)
Definition postinit.c:616
void StoreConnectionWarning(char *msg, char *detail)
Definition postinit.c:1491
PGDLLIMPORT int maintenance_work_mem
Definition globals.c:135
void GetUserIdAndSecContext(Oid *userid, int *sec_context)
Definition miscinit.c:613
PGDLLIMPORT int MyCancelKeyLength
Definition globals.c:55
void SetSessionAuthorization(Oid userid, bool is_superuser)
Definition miscinit.c:922
void process_session_preload_libraries(void)
Definition miscinit.c:1867
PGDLLIMPORT bool enableFsync
Definition globals.c:131
PGDLLIMPORT bool ExitOnAnyError
Definition globals.c:125
PGDLLIMPORT volatile sig_atomic_t IdleInTransactionSessionTimeoutPending
Definition globals.c:37
const char * GetSystemUser(void)
Definition miscinit.c:536
bool InSecurityRestrictedOperation(void)
Definition miscinit.c:640
PGDLLIMPORT char * shared_preload_libraries_string
Definition miscinit.c:1784
Oid GetUserId(void)
Definition miscinit.c:470
PGDLLIMPORT bool allowSystemTableMods
Definition globals.c:132
bool GetSessionUserIsSuperuser(void)
Definition miscinit.c:516
const char * GetBackendTypeDesc(BackendType backendType)
Definition miscinit.c:264
PGDLLIMPORT bool IsBinaryUpgrade
Definition globals.c:123
Size EstimateClientConnectionInfoSpace(void)
Definition miscinit.c:1037
PGDLLIMPORT volatile sig_atomic_t LogMemoryContextPending
Definition globals.c:41
PGDLLIMPORT int VacuumCostPageDirty
Definition globals.c:156
PGDLLIMPORT int data_directory_mode
Definition globals.c:79
Oid GetSessionUserId(void)
Definition miscinit.c:509
void SetCurrentRoleId(Oid roleid, bool is_superuser)
Definition miscinit.c:958
PGDLLIMPORT bool VacuumCostActive
Definition globals.c:161
PGDLLIMPORT int subtransaction_buffers
Definition globals.c:169
PGDLLIMPORT volatile sig_atomic_t InterruptPending
Definition globals.c:32
PGDLLIMPORT bool IgnoreSystemIndexes
Definition miscinit.c:82
Oid GetAuthenticatedUserId(void)
Definition miscinit.c:546
PGDLLIMPORT int VacuumCostLimit
Definition globals.c:157
PGDLLIMPORT bool MyDatabaseHasLoginEventTriggers
Definition globals.c:100
PGDLLIMPORT volatile sig_atomic_t ProcSignalBarrierPending
Definition globals.c:40
PGDLLIMPORT int MaxConnections
Definition globals.c:145
PGDLLIMPORT int NBuffers
Definition globals.c:144
bool InLocalUserIdChange(void)
Definition miscinit.c:631
PGDLLIMPORT int VacuumCostPageHit
Definition globals.c:154
PGDLLIMPORT bool process_shmem_requests_in_progress
Definition miscinit.c:1792
void SetDatabasePath(const char *path)
Definition miscinit.c:284
void InitPostmasterChild(void)
Definition miscinit.c:97
void process_shared_preload_libraries(void)
Definition miscinit.c:1853
PGDLLIMPORT volatile sig_atomic_t IdleStatsUpdateTimeoutPending
Definition globals.c:42
PGDLLIMPORT int notify_buffers
Definition globals.c:167
PGDLLIMPORT bool process_shared_preload_libraries_in_progress
Definition miscinit.c:1788
void InitializeFastPathLocks(void)
Definition postinit.c:584
PGDLLIMPORT struct Latch * MyLatch
Definition globals.c:65
PGDLLIMPORT TimestampTz MyStartTimestamp
Definition globals.c:51
PGDLLIMPORT char * DatabasePath
Definition globals.c:106
PGDLLIMPORT int MyPMChildSlot
Definition globals.c:56
void TouchSocketLockFiles(void)
Definition miscinit.c:1492
PGDLLIMPORT double hash_mem_multiplier
Definition globals.c:134
PGDLLIMPORT volatile int ProcDieSenderUid
Definition globals.c:47
size_t get_hash_memory_limit(void)
Definition nodeHash.c:3680
PGDLLIMPORT int max_stack_depth
Definition stack_depth.c:26
PGDLLIMPORT volatile sig_atomic_t ClientConnectionLost
Definition globals.c:36
void RestoreClientConnectionInfo(char *conninfo)
Definition miscinit.c:1086
PGDLLIMPORT int DateOrder
Definition globals.c:128
PGDLLIMPORT int max_parallel_maintenance_workers
Definition globals.c:136
PGDLLIMPORT char * local_preload_libraries_string
Definition miscinit.c:1785
PGDLLIMPORT BackendType MyBackendType
Definition miscinit.c:65
bool InNoForceRLSOperation(void)
Definition miscinit.c:649
PGDLLIMPORT int serializable_buffers
Definition globals.c:168
PGDLLIMPORT volatile sig_atomic_t QueryCancelPending
Definition globals.c:33
bool superuser_arg(Oid roleid)
Definition superuser.c:57
PGDLLIMPORT char * session_preload_libraries_string
Definition miscinit.c:1783
PGDLLIMPORT int multixact_member_buffers
Definition globals.c:165
void PreventCommandDuringRecovery(const char *cmdname)
Definition utility.c:446
PGDLLIMPORT volatile sig_atomic_t CheckClientConnectionPending
Definition globals.c:35
PGDLLIMPORT int autovacuum_max_parallel_workers
Definition globals.c:148
bool stack_is_too_deep(void)
PGDLLIMPORT pg_time_t MyStartTime
Definition globals.c:50
PGDLLIMPORT volatile sig_atomic_t ProcDiePending
Definition globals.c:34
void ProcessInterrupts(void)
Definition postgres.c:3350
void SetAuthenticatedUserId(Oid userid)
Definition miscinit.c:553
PGDLLIMPORT int VacuumBufferUsageLimit
Definition globals.c:152
PGDLLIMPORT char pkglib_path[]
Definition globals.c:84
PGDLLIMPORT char my_exec_path[]
Definition globals.c:83
Oid GetCurrentRoleId(void)
Definition miscinit.c:937
void checkDataDir(void)
Definition miscinit.c:297
bool superuser(void)
Definition superuser.c:47
PGDLLIMPORT pid_t PostmasterPid
Definition globals.c:108
void InitPostgres(const char *in_dbname, Oid dboid, const char *username, Oid useroid, uint32 flags, char *out_dbname)
Definition postinit.c:719
PGDLLIMPORT int VacuumCostPageMiss
Definition globals.c:155
PGDLLIMPORT volatile uint32 QueryCancelHoldoffCount
Definition globals.c:44
PGDLLIMPORT int work_mem
Definition globals.c:133
void SwitchToSharedLatch(void)
Definition miscinit.c:216
PGDLLIMPORT int multixact_offset_buffers
Definition globals.c:166
PGDLLIMPORT int DateStyle
Definition globals.c:127
void GetUserIdAndContext(Oid *userid, bool *sec_def_context)
Definition miscinit.c:662
BackendType
Definition miscadmin.h:350
@ B_WAL_SUMMARIZER
Definition miscadmin.h:379
@ B_WAL_WRITER
Definition miscadmin.h:380
@ B_WAL_RECEIVER
Definition miscadmin.h:378
@ B_CHECKPOINTER
Definition miscadmin.h:375
@ B_DATACHECKSUMSWORKER_WORKER
Definition miscadmin.h:383
@ B_WAL_SENDER
Definition miscadmin.h:359
@ B_IO_WORKER
Definition miscadmin.h:376
@ B_LOGGER
Definition miscadmin.h:389
@ B_STARTUP
Definition miscadmin.h:377
@ B_DATACHECKSUMSWORKER_LAUNCHER
Definition miscadmin.h:382
@ B_BG_WORKER
Definition miscadmin.h:358
@ B_INVALID
Definition miscadmin.h:351
@ B_STANDALONE_BACKEND
Definition miscadmin.h:362
@ B_BG_WRITER
Definition miscadmin.h:374
@ B_BACKEND
Definition miscadmin.h:354
@ B_ARCHIVER
Definition miscadmin.h:373
@ B_AUTOVAC_LAUNCHER
Definition miscadmin.h:356
@ B_SLOTSYNC_WORKER
Definition miscadmin.h:360
@ B_DEAD_END_BACKEND
Definition miscadmin.h:355
@ B_AUTOVAC_WORKER
Definition miscadmin.h:357
void SetDataDir(const char *dir)
Definition miscinit.c:390
PGDLLIMPORT volatile sig_atomic_t IdleSessionTimeoutPending
Definition globals.c:39
PGDLLIMPORT Oid MyDatabaseId
Definition globals.c:96
void SetUserIdAndContext(Oid userid, bool sec_def_context)
Definition miscinit.c:669
PGDLLIMPORT char OutputFileName[]
Definition globals.c:81
PGDLLIMPORT int transaction_buffers
Definition globals.c:170
PGDLLIMPORT int max_worker_processes
Definition globals.c:146
PGDLLIMPORT bool accessSharedCatalogsInDecoding
Definition snapbuild.c:163
PGDLLIMPORT ProcessingMode Mode
Definition miscinit.c:63
void(* shmem_request_hook_type)(void)
Definition miscadmin.h:552
void pg_bindtextdomain(const char *domain)
Definition miscinit.c:1890
bool has_rolreplication(Oid roleid)
Definition miscinit.c:689
char * GetUserNameFromId(Oid roleid, bool noerr)
Definition miscinit.c:990
PGDLLIMPORT char * DataDir
Definition globals.c:73
PGDLLIMPORT int MaxBackends
Definition globals.c:149
char * pg_stack_base_t
Definition miscadmin.h:302
PGDLLIMPORT bool process_shared_preload_libraries_done
Definition miscinit.c:1789
void ValidatePgVersion(const char *path)
Definition miscinit.c:1720
PGDLLIMPORT volatile uint32 CritSectionCount
Definition globals.c:45
void SetUserIdAndSecContext(Oid userid, int sec_context)
Definition miscinit.c:620
bool RecheckDataDirLockFile(void)
Definition miscinit.c:1648
void check_stack_depth(void)
Definition stack_depth.c:95
pg_stack_base_t set_stack_base(void)
Definition stack_depth.c:44
void CreateDataDirLockFile(bool amPostmaster)
Definition miscinit.c:1465
void SwitchBackToLocalLatch(void)
Definition miscinit.c:243
void CreateSocketLockFile(const char *socketfile, bool amPostmaster, const char *socketDir)
Definition miscinit.c:1474
PGDLLIMPORT volatile sig_atomic_t TransactionTimeoutPending
Definition globals.c:38
PGDLLIMPORT int max_parallel_workers
Definition globals.c:147
PGDLLIMPORT int MyProcPid
Definition globals.c:49
static char * argv0
Definition pg_ctl.c:94
int64 pg_time_t
Definition pgtime.h:23
unsigned int Oid
static int fb(int x)
Definition latch.h:116
static char * authn_id
Definition validator.c:41