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