32#define InvalidPid (-1)
113#define INTERRUPTS_PENDING_CONDITION() \
114 (unlikely(InterruptPending))
116#define INTERRUPTS_PENDING_CONDITION() \
117 (unlikely(UNBLOCKED_SIGNAL_QUEUE()) ? pgwin32_dispatch_queued_signals() : 0, \
118 unlikely(InterruptPending))
122#define CHECK_FOR_INTERRUPTS() \
124 if (INTERRUPTS_PENDING_CONDITION()) \
125 ProcessInterrupts(); \
129#define INTERRUPTS_CAN_BE_PROCESSED() \
130 (InterruptHoldoffCount == 0 && CritSectionCount == 0 && \
131 QueryCancelHoldoffCount == 0)
133#define HOLD_INTERRUPTS() (InterruptHoldoffCount++)
135#define RESUME_INTERRUPTS() \
137 Assert(InterruptHoldoffCount > 0); \
138 InterruptHoldoffCount--; \
141#define HOLD_CANCEL_INTERRUPTS() (QueryCancelHoldoffCount++)
143#define RESUME_CANCEL_INTERRUPTS() \
145 Assert(QueryCancelHoldoffCount > 0); \
146 QueryCancelHoldoffCount--; \
149#define START_CRIT_SECTION() (CritSectionCount++)
151#define END_CRIT_SECTION() \
153 Assert(CritSectionCount > 0); \
154 CritSectionCount--; \
235#define USE_POSTGRES_DATES 0
236#define USE_ISO_DATES 1
237#define USE_SQL_DATES 2
238#define USE_GERMAN_DATES 3
239#define USE_XSD_DATES 4
242#define DATEORDER_YMD 0
243#define DATEORDER_DMY 1
244#define DATEORDER_MDY 2
256#define INTSTYLE_POSTGRES 0
257#define INTSTYLE_POSTGRES_VERBOSE 1
258#define INTSTYLE_SQL_STANDARD 2
259#define INTSTYLE_ISO_8601 3
277#define MIN_BAS_VAC_RING_SIZE_KB 128
278#define MAX_BAS_VAC_RING_SIZE_KB (16 * 1024 * 1024)
296#define STACK_DEPTH_SLOP (512 * 1024)
317#define SECURITY_LOCAL_USERID_CHANGE 0x0001
318#define SECURITY_RESTRICTED_OPERATION 0x0002
319#define SECURITY_NOFORCE_RLS 0x0004
375#define BACKEND_NUM_TYPES (B_LOGGER + 1)
379#define AmRegularBackendProcess() (MyBackendType == B_BACKEND)
380#define AmAutoVacuumLauncherProcess() (MyBackendType == B_AUTOVAC_LAUNCHER)
381#define AmAutoVacuumWorkerProcess() (MyBackendType == B_AUTOVAC_WORKER)
382#define AmBackgroundWorkerProcess() (MyBackendType == B_BG_WORKER)
383#define AmWalSenderProcess() (MyBackendType == B_WAL_SENDER)
384#define AmLogicalSlotSyncWorkerProcess() (MyBackendType == B_SLOTSYNC_WORKER)
385#define AmArchiverProcess() (MyBackendType == B_ARCHIVER)
386#define AmBackgroundWriterProcess() (MyBackendType == B_BG_WRITER)
387#define AmCheckpointerProcess() (MyBackendType == B_CHECKPOINTER)
388#define AmStartupProcess() (MyBackendType == B_STARTUP)
389#define AmWalReceiverProcess() (MyBackendType == B_WAL_RECEIVER)
390#define AmWalSummarizerProcess() (MyBackendType == B_WAL_SUMMARIZER)
391#define AmWalWriterProcess() (MyBackendType == B_WAL_WRITER)
393#define AmSpecialWorkerProcess() \
394 (AmAutoVacuumLauncherProcess() || \
395 AmLogicalSlotSyncWorkerProcess())
419 bool bypass_login_check);
425 const char *auth_method);
466#define IsBootstrapProcessingMode() (Mode == BootstrapProcessing)
467#define IsInitProcessingMode() (Mode == InitProcessing)
468#define IsNormalProcessingMode() (Mode == NormalProcessing)
470#define GetProcessingMode() Mode
472#define SetProcessingMode(mode) \
474 Assert((mode) == BootstrapProcessing || \
475 (mode) == InitProcessing || \
476 (mode) == NormalProcessing); \
488#define INIT_PG_LOAD_SESSION_LIBS 0x0001
489#define INIT_PG_OVERRIDE_ALLOW_CONNS 0x0002
490#define INIT_PG_OVERRIDE_ROLE_LOGIN 0x0004
491extern void pg_split_opts(
char **argv,
int *argcp,
const char *optstr);
511 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)
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 bool MyCancelKeyValid
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)
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 int32 MyCancelKey
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)