32 #define InvalidPid (-1)
112 #define INTERRUPTS_PENDING_CONDITION() \
113 (unlikely(InterruptPending))
115 #define INTERRUPTS_PENDING_CONDITION() \
116 (unlikely(UNBLOCKED_SIGNAL_QUEUE()) ? pgwin32_dispatch_queued_signals() : 0, \
117 unlikely(InterruptPending))
121 #define CHECK_FOR_INTERRUPTS() \
123 if (INTERRUPTS_PENDING_CONDITION()) \
124 ProcessInterrupts(); \
128 #define INTERRUPTS_CAN_BE_PROCESSED() \
129 (InterruptHoldoffCount == 0 && CritSectionCount == 0 && \
130 QueryCancelHoldoffCount == 0)
132 #define HOLD_INTERRUPTS() (InterruptHoldoffCount++)
134 #define RESUME_INTERRUPTS() \
136 Assert(InterruptHoldoffCount > 0); \
137 InterruptHoldoffCount--; \
140 #define HOLD_CANCEL_INTERRUPTS() (QueryCancelHoldoffCount++)
142 #define RESUME_CANCEL_INTERRUPTS() \
144 Assert(QueryCancelHoldoffCount > 0); \
145 QueryCancelHoldoffCount--; \
148 #define START_CRIT_SECTION() (CritSectionCount++)
150 #define END_CRIT_SECTION() \
152 Assert(CritSectionCount > 0); \
153 CritSectionCount--; \
229 #define USE_POSTGRES_DATES 0
230 #define USE_ISO_DATES 1
231 #define USE_SQL_DATES 2
232 #define USE_GERMAN_DATES 3
233 #define USE_XSD_DATES 4
236 #define DATEORDER_YMD 0
237 #define DATEORDER_DMY 1
238 #define DATEORDER_MDY 2
250 #define INTSTYLE_POSTGRES 0
251 #define INTSTYLE_POSTGRES_VERBOSE 1
252 #define INTSTYLE_SQL_STANDARD 2
253 #define INTSTYLE_ISO_8601 3
271 #define MIN_BAS_VAC_RING_SIZE_KB 128
272 #define MAX_BAS_VAC_RING_SIZE_KB (16 * 1024 * 1024)
313 #define SECURITY_LOCAL_USERID_CHANGE 0x0001
314 #define SECURITY_RESTRICTED_OPERATION 0x0002
315 #define SECURITY_NOFORCE_RLS 0x0004
344 #define BACKEND_NUM_TYPES (B_WAL_WRITER + 1)
373 const char *auth_method);
414 #define IsBootstrapProcessingMode() (Mode == BootstrapProcessing)
415 #define IsInitProcessingMode() (Mode == InitProcessing)
416 #define IsNormalProcessingMode() (Mode == NormalProcessing)
418 #define GetProcessingMode() Mode
420 #define SetProcessingMode(mode) \
422 Assert((mode) == BootstrapProcessing || \
423 (mode) == InitProcessing || \
424 (mode) == NormalProcessing); \
452 #define AmStartupProcess() (MyAuxProcType == StartupProcess)
453 #define AmBackgroundWriterProcess() (MyAuxProcType == BgWriterProcess)
454 #define AmArchiverProcess() (MyAuxProcType == ArchiverProcess)
455 #define AmCheckpointerProcess() (MyAuxProcType == CheckpointerProcess)
456 #define AmWalWriterProcess() (MyAuxProcType == WalWriterProcess)
457 #define AmWalReceiverProcess() (MyAuxProcType == WalReceiverProcess)
466 extern void pg_split_opts(
char **argv,
int *argcp,
const char *optstr);
470 bool load_session_libraries,
471 bool override_allow_connections,
486 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 InitStandaloneProcess(const char *argv0)
void SerializeClientConnectionInfo(Size maxsize, char *start_address)
void PreventCommandIfParallelMode(const char *cmdname)
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 AuxProcType MyAuxProcType
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 volatile sig_atomic_t InterruptPending
PGDLLIMPORT bool IgnoreSystemIndexes
Oid GetAuthenticatedUserId(void)
PGDLLIMPORT int VacuumCostLimit
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 InitializeSessionUserId(const char *rolename, Oid roleid)
void process_shared_preload_libraries(void)
PGDLLIMPORT volatile sig_atomic_t IdleStatsUpdateTimeoutPending
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 bool IsBackgroundWorker
PGDLLIMPORT int64 VacuumPageDirty
PGDLLIMPORT int max_parallel_maintenance_workers
PGDLLIMPORT char * local_preload_libraries_string
PGDLLIMPORT BackendType MyBackendType
bool InNoForceRLSOperation(void)
PGDLLIMPORT volatile sig_atomic_t QueryCancelPending
bool superuser_arg(Oid roleid)
PGDLLIMPORT char * session_preload_libraries_string
void PreventCommandDuringRecovery(const char *cmdname)
PGDLLIMPORT volatile sig_atomic_t CheckClientConnectionPending
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 int trace_recovery_messages
PGDLLIMPORT int64 VacuumPageMiss
void SwitchToSharedLatch(void)
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 max_worker_processes
PGDLLIMPORT ProcessingMode Mode
PGDLLIMPORT int64 VacuumPageHit
void InitPostgres(const char *in_dbname, Oid dboid, const char *username, Oid useroid, bool load_session_libraries, bool override_allow_connections, char *out_dbname)
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)
int trace_recovery(int trace_level)
void SwitchBackToLocalLatch(void)
void CreateSocketLockFile(const char *socketfile, bool amPostmaster, const char *socketDir)
PGDLLIMPORT int max_parallel_workers
PGDLLIMPORT int MyProcPid
static bool is_superuser(Archive *fout)