32#define InvalidPid (-1)
114#define INTERRUPTS_PENDING_CONDITION() \
115 (unlikely(InterruptPending))
117#define INTERRUPTS_PENDING_CONDITION() \
118 (unlikely(UNBLOCKED_SIGNAL_QUEUE()) ? pgwin32_dispatch_queued_signals() : 0, \
119 unlikely(InterruptPending))
123#define CHECK_FOR_INTERRUPTS() \
125 if (INTERRUPTS_PENDING_CONDITION()) \
126 ProcessInterrupts(); \
130#define INTERRUPTS_CAN_BE_PROCESSED() \
131 (InterruptHoldoffCount == 0 && CritSectionCount == 0 && \
132 QueryCancelHoldoffCount == 0)
134#define HOLD_INTERRUPTS() (InterruptHoldoffCount++)
136#define RESUME_INTERRUPTS() \
138 Assert(InterruptHoldoffCount > 0); \
139 InterruptHoldoffCount--; \
142#define HOLD_CANCEL_INTERRUPTS() (QueryCancelHoldoffCount++)
144#define RESUME_CANCEL_INTERRUPTS() \
146 Assert(QueryCancelHoldoffCount > 0); \
147 QueryCancelHoldoffCount--; \
150#define START_CRIT_SECTION() (CritSectionCount++)
152#define END_CRIT_SECTION() \
154 Assert(CritSectionCount > 0); \
155 CritSectionCount--; \
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
243#define DATEORDER_YMD 0
244#define DATEORDER_DMY 1
245#define DATEORDER_MDY 2
257#define INTSTYLE_POSTGRES 0
258#define INTSTYLE_POSTGRES_VERBOSE 1
259#define INTSTYLE_SQL_STANDARD 2
260#define INTSTYLE_ISO_8601 3
278#define MIN_BAS_VAC_RING_SIZE_KB 128
279#define MAX_BAS_VAC_RING_SIZE_KB (16 * 1024 * 1024)
297#define STACK_DEPTH_SLOP (512 * 1024)
318#define SECURITY_LOCAL_USERID_CHANGE 0x0001
319#define SECURITY_RESTRICTED_OPERATION 0x0002
320#define SECURITY_NOFORCE_RLS 0x0004
377#define BACKEND_NUM_TYPES (B_LOGGER + 1)
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)
396#define AmSpecialWorkerProcess() \
397 (AmAutoVacuumLauncherProcess() || \
398 AmLogicalSlotSyncWorkerProcess())
405#define IsExternalConnectionBackend(backend_type) \
406 (backend_type == B_BACKEND || backend_type == B_WAL_SENDER)
430 bool bypass_login_check);
436 const char *auth_method);
477#define IsBootstrapProcessingMode() (Mode == BootstrapProcessing)
478#define IsInitProcessingMode() (Mode == InitProcessing)
479#define IsNormalProcessingMode() (Mode == NormalProcessing)
481#define GetProcessingMode() Mode
483#define SetProcessingMode(mode) \
485 Assert((mode) == BootstrapProcessing || \
486 (mode) == InitProcessing || \
487 (mode) == NormalProcessing); \
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);
522 const char *socketDir);
PGDLLIMPORT int IntervalStyle
PGDLLIMPORT shmem_request_hook_type shmem_request_hook
PGDLLIMPORT double VacuumCostDelay
void ChangeToDataDir(void)
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
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)
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
PGDLLIMPORT volatile sig_atomic_t PublishMemoryContextPending
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
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
void InitPostgres(const char *in_dbname, Oid dboid, const char *username, Oid useroid, bits32 flags, char *out_dbname)
PGDLLIMPORT char MyCancelKey[]
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
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)
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 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
static bool is_superuser(Archive *fout)