32#define InvalidPid (-1)
115#define INTERRUPTS_PENDING_CONDITION() \
116 (unlikely(InterruptPending))
118#define INTERRUPTS_PENDING_CONDITION() \
119 (unlikely(UNBLOCKED_SIGNAL_QUEUE()) ? \
120 pgwin32_dispatch_queued_signals() : (void) 0, \
121 unlikely(InterruptPending))
125#define CHECK_FOR_INTERRUPTS() \
127 if (INTERRUPTS_PENDING_CONDITION()) \
128 ProcessInterrupts(); \
132#define INTERRUPTS_CAN_BE_PROCESSED() \
133 (InterruptHoldoffCount == 0 && CritSectionCount == 0 && \
134 QueryCancelHoldoffCount == 0)
136#define HOLD_INTERRUPTS() (InterruptHoldoffCount++)
138#define RESUME_INTERRUPTS() \
140 Assert(InterruptHoldoffCount > 0); \
141 InterruptHoldoffCount--; \
144#define HOLD_CANCEL_INTERRUPTS() (QueryCancelHoldoffCount++)
146#define RESUME_CANCEL_INTERRUPTS() \
148 Assert(QueryCancelHoldoffCount > 0); \
149 QueryCancelHoldoffCount--; \
152#define START_CRIT_SECTION() (CritSectionCount++)
154#define END_CRIT_SECTION() \
156 Assert(CritSectionCount > 0); \
157 CritSectionCount--; \
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
246#define DATEORDER_YMD 0
247#define DATEORDER_DMY 1
248#define DATEORDER_MDY 2
260#define INTSTYLE_POSTGRES 0
261#define INTSTYLE_POSTGRES_VERBOSE 1
262#define INTSTYLE_SQL_STANDARD 2
263#define INTSTYLE_ISO_8601 3
281#define MIN_BAS_VAC_RING_SIZE_KB 128
282#define MAX_BAS_VAC_RING_SIZE_KB (16 * 1024 * 1024)
300#define STACK_DEPTH_SLOP (512 * 1024)
330#define SECURITY_LOCAL_USERID_CHANGE 0x0001
331#define SECURITY_RESTRICTED_OPERATION 0x0002
332#define SECURITY_NOFORCE_RLS 0x0004
392#define BACKEND_NUM_TYPES (B_LOGGER + 1)
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)
414#define AmSpecialWorkerProcess() \
415 (AmAutoVacuumLauncherProcess() || \
416 AmLogicalSlotSyncWorkerProcess())
423#define IsExternalConnectionBackend(backend_type) \
424 (backend_type == B_BACKEND || backend_type == B_WAL_SENDER)
454 const char *auth_method);
495#define IsBootstrapProcessingMode() (Mode == BootstrapProcessing)
496#define IsInitProcessingMode() (Mode == InitProcessing)
497#define IsNormalProcessingMode() (Mode == NormalProcessing)
499#define GetProcessingMode() Mode
501#define SetProcessingMode(mode) \
503 Assert((mode) == BootstrapProcessing || \
504 (mode) == InitProcessing || \
505 (mode) == NormalProcessing); \
517#define INIT_PG_LOAD_SESSION_LIBS 0x0001
518#define INIT_PG_OVERRIDE_ALLOW_CONNS 0x0002
519#define INIT_PG_OVERRIDE_ROLE_LOGIN 0x0004
PGDLLIMPORT int IntervalStyle
PGDLLIMPORT shmem_request_hook_type shmem_request_hook
PGDLLIMPORT double VacuumCostDelay
void ChangeToDataDir(void)
PGDLLIMPORT uint8 MyCancelKey[]
PGDLLIMPORT bool IsPostmasterEnvironment
void process_shmem_requests(void)
PGDLLIMPORT struct Port * MyProcPort
void restore_stack_base(pg_stack_base_t base)
void InitializeMaxBackends(void)
void PreventCommandIfReadOnly(const char *cmdname)
PGDLLIMPORT volatile uint32 InterruptHoldoffCount
PGDLLIMPORT volatile int ProcDieSenderPid
void pg_split_opts(char **argv, int *argcp, const char *optstr)
void InitializeSessionUserId(const char *rolename, Oid roleid, bool bypass_login_check)
void InitStandaloneProcess(const char *argv0)
void SerializeClientConnectionInfo(Size maxsize, char *start_address)
void PreventCommandIfParallelMode(const char *cmdname)
PGDLLIMPORT int commit_timestamp_buffers
PGDLLIMPORT bool IsUnderPostmaster
void InitializeSystemUser(const char *authn_id, const char *auth_method)
PGDLLIMPORT int VacuumCostBalance
PGDLLIMPORT Oid MyDatabaseTableSpace
void InitializeSessionUserIdStandalone(void)
ssize_t get_stack_depth_rlimit(void)
void AddToDataDirLockFile(int target_line, const char *str)
void InitProcessLocalLatch(void)
void StoreConnectionWarning(char *msg, char *detail)
PGDLLIMPORT int maintenance_work_mem
void GetUserIdAndSecContext(Oid *userid, int *sec_context)
PGDLLIMPORT int MyCancelKeyLength
void SetSessionAuthorization(Oid userid, bool is_superuser)
void process_session_preload_libraries(void)
PGDLLIMPORT bool enableFsync
PGDLLIMPORT bool ExitOnAnyError
PGDLLIMPORT volatile sig_atomic_t IdleInTransactionSessionTimeoutPending
const char * GetSystemUser(void)
bool InSecurityRestrictedOperation(void)
PGDLLIMPORT char * shared_preload_libraries_string
PGDLLIMPORT bool allowSystemTableMods
bool GetSessionUserIsSuperuser(void)
const char * GetBackendTypeDesc(BackendType backendType)
PGDLLIMPORT bool IsBinaryUpgrade
Size EstimateClientConnectionInfoSpace(void)
PGDLLIMPORT volatile sig_atomic_t LogMemoryContextPending
PGDLLIMPORT int VacuumCostPageDirty
PGDLLIMPORT int data_directory_mode
Oid GetSessionUserId(void)
void SetCurrentRoleId(Oid roleid, bool is_superuser)
PGDLLIMPORT bool VacuumCostActive
PGDLLIMPORT int subtransaction_buffers
PGDLLIMPORT volatile sig_atomic_t InterruptPending
PGDLLIMPORT bool IgnoreSystemIndexes
Oid GetAuthenticatedUserId(void)
PGDLLIMPORT int VacuumCostLimit
PGDLLIMPORT bool MyDatabaseHasLoginEventTriggers
PGDLLIMPORT volatile sig_atomic_t ProcSignalBarrierPending
PGDLLIMPORT int MaxConnections
bool InLocalUserIdChange(void)
PGDLLIMPORT int VacuumCostPageHit
PGDLLIMPORT bool process_shmem_requests_in_progress
void SetDatabasePath(const char *path)
void InitPostmasterChild(void)
void process_shared_preload_libraries(void)
PGDLLIMPORT volatile sig_atomic_t IdleStatsUpdateTimeoutPending
PGDLLIMPORT int notify_buffers
PGDLLIMPORT bool process_shared_preload_libraries_in_progress
void InitializeFastPathLocks(void)
PGDLLIMPORT struct Latch * MyLatch
PGDLLIMPORT TimestampTz MyStartTimestamp
PGDLLIMPORT char * DatabasePath
PGDLLIMPORT int MyPMChildSlot
void TouchSocketLockFiles(void)
PGDLLIMPORT double hash_mem_multiplier
PGDLLIMPORT volatile int ProcDieSenderUid
size_t get_hash_memory_limit(void)
PGDLLIMPORT int max_stack_depth
PGDLLIMPORT volatile sig_atomic_t ClientConnectionLost
void RestoreClientConnectionInfo(char *conninfo)
PGDLLIMPORT int DateOrder
PGDLLIMPORT int max_parallel_maintenance_workers
PGDLLIMPORT char * local_preload_libraries_string
PGDLLIMPORT BackendType MyBackendType
bool InNoForceRLSOperation(void)
PGDLLIMPORT int serializable_buffers
PGDLLIMPORT volatile sig_atomic_t QueryCancelPending
bool superuser_arg(Oid roleid)
PGDLLIMPORT char * session_preload_libraries_string
PGDLLIMPORT int multixact_member_buffers
void PreventCommandDuringRecovery(const char *cmdname)
PGDLLIMPORT volatile sig_atomic_t CheckClientConnectionPending
PGDLLIMPORT int autovacuum_max_parallel_workers
bool stack_is_too_deep(void)
PGDLLIMPORT pg_time_t MyStartTime
PGDLLIMPORT volatile sig_atomic_t ProcDiePending
void ProcessInterrupts(void)
void SetAuthenticatedUserId(Oid userid)
PGDLLIMPORT int VacuumBufferUsageLimit
PGDLLIMPORT char pkglib_path[]
PGDLLIMPORT char my_exec_path[]
Oid GetCurrentRoleId(void)
PGDLLIMPORT pid_t PostmasterPid
void InitPostgres(const char *in_dbname, Oid dboid, const char *username, Oid useroid, uint32 flags, char *out_dbname)
PGDLLIMPORT int VacuumCostPageMiss
PGDLLIMPORT volatile uint32 QueryCancelHoldoffCount
void SwitchToSharedLatch(void)
PGDLLIMPORT int multixact_offset_buffers
PGDLLIMPORT int DateStyle
void GetUserIdAndContext(Oid *userid, bool *sec_def_context)
@ B_DATACHECKSUMSWORKER_WORKER
@ B_DATACHECKSUMSWORKER_LAUNCHER
void SetDataDir(const char *dir)
PGDLLIMPORT volatile sig_atomic_t IdleSessionTimeoutPending
PGDLLIMPORT Oid MyDatabaseId
void SetUserIdAndContext(Oid userid, bool sec_def_context)
PGDLLIMPORT char OutputFileName[]
PGDLLIMPORT int transaction_buffers
PGDLLIMPORT int max_worker_processes
PGDLLIMPORT bool accessSharedCatalogsInDecoding
PGDLLIMPORT ProcessingMode Mode
void(* shmem_request_hook_type)(void)
void pg_bindtextdomain(const char *domain)
bool has_rolreplication(Oid roleid)
char * GetUserNameFromId(Oid roleid, bool noerr)
PGDLLIMPORT char * DataDir
PGDLLIMPORT int MaxBackends
PGDLLIMPORT bool process_shared_preload_libraries_done
void ValidatePgVersion(const char *path)
PGDLLIMPORT volatile uint32 CritSectionCount
void SetUserIdAndSecContext(Oid userid, int sec_context)
bool RecheckDataDirLockFile(void)
void check_stack_depth(void)
pg_stack_base_t set_stack_base(void)
void CreateDataDirLockFile(bool amPostmaster)
void SwitchBackToLocalLatch(void)
void CreateSocketLockFile(const char *socketfile, bool amPostmaster, const char *socketDir)
PGDLLIMPORT volatile sig_atomic_t TransactionTimeoutPending
PGDLLIMPORT int max_parallel_workers
PGDLLIMPORT int MyProcPid