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--; \
234 #define USE_POSTGRES_DATES 0
235 #define USE_ISO_DATES 1
236 #define USE_SQL_DATES 2
237 #define USE_GERMAN_DATES 3
238 #define USE_XSD_DATES 4
241 #define DATEORDER_YMD 0
242 #define DATEORDER_DMY 1
243 #define DATEORDER_MDY 2
255 #define INTSTYLE_POSTGRES 0
256 #define INTSTYLE_POSTGRES_VERBOSE 1
257 #define INTSTYLE_SQL_STANDARD 2
258 #define INTSTYLE_ISO_8601 3
276 #define MIN_BAS_VAC_RING_SIZE_KB 128
277 #define MAX_BAS_VAC_RING_SIZE_KB (16 * 1024 * 1024)
314 #define SECURITY_LOCAL_USERID_CHANGE 0x0001
315 #define SECURITY_RESTRICTED_OPERATION 0x0002
316 #define SECURITY_NOFORCE_RLS 0x0004
367 #define BACKEND_NUM_TYPES (B_LOGGER + 1)
371 #define AmAutoVacuumLauncherProcess() (MyBackendType == B_AUTOVAC_LAUNCHER)
372 #define AmAutoVacuumWorkerProcess() (MyBackendType == B_AUTOVAC_WORKER)
373 #define AmBackgroundWorkerProcess() (MyBackendType == B_BG_WORKER)
374 #define AmWalSenderProcess() (MyBackendType == B_WAL_SENDER)
375 #define AmLogicalSlotSyncWorkerProcess() (MyBackendType == B_SLOTSYNC_WORKER)
376 #define AmArchiverProcess() (MyBackendType == B_ARCHIVER)
377 #define AmBackgroundWriterProcess() (MyBackendType == B_BG_WRITER)
378 #define AmCheckpointerProcess() (MyBackendType == B_CHECKPOINTER)
379 #define AmStartupProcess() (MyBackendType == B_STARTUP)
380 #define AmWalReceiverProcess() (MyBackendType == B_WAL_RECEIVER)
381 #define AmWalSummarizerProcess() (MyBackendType == B_WAL_SUMMARIZER)
382 #define AmWalWriterProcess() (MyBackendType == B_WAL_WRITER)
404 bool bypass_login_check);
410 const char *auth_method);
451 #define IsBootstrapProcessingMode() (Mode == BootstrapProcessing)
452 #define IsInitProcessingMode() (Mode == InitProcessing)
453 #define IsNormalProcessingMode() (Mode == NormalProcessing)
455 #define GetProcessingMode() Mode
457 #define SetProcessingMode(mode) \
459 Assert((mode) == BootstrapProcessing || \
460 (mode) == InitProcessing || \
461 (mode) == NormalProcessing); \
473 #define INIT_PG_LOAD_SESSION_LIBS 0x0001
474 #define INIT_PG_OVERRIDE_ALLOW_CONNS 0x0002
475 #define INIT_PG_OVERRIDE_ROLE_LOGIN 0x0004
476 extern void pg_split_opts(
char **argv,
int *argcp,
const char *optstr);
495 const char *socketDir);
PGDLLIMPORT int IntervalStyle
PGDLLIMPORT shmem_request_hook_type shmem_request_hook
PGDLLIMPORT double VacuumCostDelay
void ChangeToDataDir(void)
char * GetUserNameFromId(Oid roleid, bool noerr)
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)
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
bool InSecurityRestrictedOperation(void)
PGDLLIMPORT char * shared_preload_libraries_string
PGDLLIMPORT bool allowSystemTableMods
PGDLLIMPORT bool IsBinaryUpgrade
Size EstimateClientConnectionInfoSpace(void)
PGDLLIMPORT volatile sig_atomic_t LogMemoryContextPending
const char * GetSystemUser(void)
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
PGDLLIMPORT struct Latch * MyLatch
PGDLLIMPORT TimestampTz MyStartTimestamp
PGDLLIMPORT char * DatabasePath
const char * GetBackendTypeDesc(BackendType backendType)
PGDLLIMPORT int MyPMChildSlot
void TouchSocketLockFiles(void)
PGDLLIMPORT double hash_mem_multiplier
size_t get_hash_memory_limit(void)
PGDLLIMPORT volatile sig_atomic_t ClientConnectionLost
void RestoreClientConnectionInfo(char *conninfo)
PGDLLIMPORT int DateOrder
PGDLLIMPORT int64 VacuumPageDirty
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)
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
PGDLLIMPORT int64 VacuumPageMiss
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
PGDLLIMPORT int64 VacuumPageHit
void(* shmem_request_hook_type)(void)
void pg_bindtextdomain(const char *domain)
bool has_rolreplication(Oid roleid)
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)