29 #define PG_BACKEND_VERSIONSTR "postgres (PostgreSQL) " PG_VERSION "\n"
31 #define InvalidPid (-1)
96 #define CHECK_FOR_INTERRUPTS() \
98 if (InterruptPending) \
99 ProcessInterrupts(); \
103 #define CHECK_FOR_INTERRUPTS() \
105 if (UNBLOCKED_SIGNAL_QUEUE()) \
106 pgwin32_dispatch_queued_signals(); \
107 if (InterruptPending) \
108 ProcessInterrupts(); \
113 #define HOLD_INTERRUPTS() (InterruptHoldoffCount++)
115 #define RESUME_INTERRUPTS() \
117 Assert(InterruptHoldoffCount > 0); \
118 InterruptHoldoffCount--; \
121 #define HOLD_CANCEL_INTERRUPTS() (QueryCancelHoldoffCount++)
123 #define RESUME_CANCEL_INTERRUPTS() \
125 Assert(QueryCancelHoldoffCount > 0); \
126 QueryCancelHoldoffCount--; \
129 #define START_CRIT_SECTION() (CritSectionCount++)
131 #define END_CRIT_SECTION() \
133 Assert(CritSectionCount > 0); \
134 CritSectionCount--; \
172 extern char postgres_exec_path[];
207 #define USE_POSTGRES_DATES 0
208 #define USE_ISO_DATES 1
209 #define USE_SQL_DATES 2
210 #define USE_GERMAN_DATES 3
211 #define USE_XSD_DATES 4
214 #define DATEORDER_YMD 0
215 #define DATEORDER_DMY 1
216 #define DATEORDER_MDY 2
228 #define INTSTYLE_POSTGRES 0
229 #define INTSTYLE_POSTGRES_VERBOSE 1
230 #define INTSTYLE_SQL_STANDARD 2
231 #define INTSTYLE_ISO_8601 3
258 #if defined(__ia64__) || defined(__ia64)
262 char *register_stack_base_ptr;
288 #define SECURITY_LOCAL_USERID_CHANGE 0x0001
289 #define SECURITY_RESTRICTED_OPERATION 0x0002
290 #define SECURITY_NOFORCE_RLS 0x0004
362 #define IsBootstrapProcessingMode() (Mode == BootstrapProcessing)
363 #define IsInitProcessingMode() (Mode == InitProcessing)
364 #define IsNormalProcessingMode() (Mode == NormalProcessing)
366 #define GetProcessingMode() Mode
368 #define SetProcessingMode(mode) \
370 AssertArg((mode) == BootstrapProcessing || \
371 (mode) == InitProcessing || \
372 (mode) == NormalProcessing); \
399 #define AmBootstrapProcess() (MyAuxProcType == BootstrapProcess)
400 #define AmStartupProcess() (MyAuxProcType == StartupProcess)
401 #define AmBackgroundWriterProcess() (MyAuxProcType == BgWriterProcess)
402 #define AmCheckpointerProcess() (MyAuxProcType == CheckpointerProcess)
403 #define AmWalWriterProcess() (MyAuxProcType == WalWriterProcess)
404 #define AmWalReceiverProcess() (MyAuxProcType == WalReceiverProcess)
413 extern void pg_split_opts(
char **argv,
int *argcp,
const char *optstr);
416 Oid useroid,
char *out_dbname);
443 #define LOCK_FILE_LINE_PID 1
444 #define LOCK_FILE_LINE_DATA_DIR 2
445 #define LOCK_FILE_LINE_START_TIME 3
446 #define LOCK_FILE_LINE_PORT 4
447 #define LOCK_FILE_LINE_SOCKET_DIR 5
448 #define LOCK_FILE_LINE_LISTEN_ADDR 6
449 #define LOCK_FILE_LINE_SHMEM_KEY 7
453 const char *socketDir);
PGDLLIMPORT int IntervalStyle
void SetUserIdAndSecContext(Oid userid, int sec_context)
bool stack_is_too_deep(void)
void PreventCommandIfParallelMode(const char *cmdname)
void InitializeSessionUserIdStandalone(void)
bool BackupInProgress(void)
void SetUserIdAndContext(Oid userid, bool sec_def_context)
bool has_rolreplication(Oid roleid)
bool InSecurityRestrictedOperation(void)
void AddToDataDirLockFile(int target_line, const char *str)
bool superuser_arg(Oid roleid)
PGDLLIMPORT Oid MyDatabaseTableSpace
void process_session_preload_libraries(void)
PGDLLIMPORT int maintenance_work_mem
PGDLLIMPORT volatile bool ProcDiePending
PGDLLIMPORT char * DataDir
void InitializeMaxBackends(void)
PGDLLIMPORT struct Latch * MyLatch
void PreventCommandIfReadOnly(const char *cmdname)
void SetDatabasePath(const char *path)
bool InLocalUserIdChange(void)
char * shared_preload_libraries_string
PGDLLIMPORT int MyProcPid
AuxProcType MyAuxProcType
bool InNoForceRLSOperation(void)
bool allowSystemTableMods
Oid GetAuthenticatedUserId(void)
void process_shared_preload_libraries(void)
void CreateSocketLockFile(const char *socketfile, bool amPostmaster, const char *socketDir)
PGDLLIMPORT volatile bool QueryCancelPending
int trace_recovery_messages
bool IsPostmasterEnvironment
char * local_preload_libraries_string
void InitPostgres(const char *in_dbname, Oid dboid, const char *username, Oid useroid, char *out_dbname)
PGDLLIMPORT struct Port * MyProcPort
PGDLLIMPORT pg_time_t MyStartTime
void check_stack_depth(void)
char * session_preload_libraries_string
void InitStandaloneProcess(const char *argv0)
void SwitchBackToLocalLatch(void)
void ValidatePgVersion(const char *path)
PGDLLIMPORT volatile uint32 QueryCancelHoldoffCount
PGDLLIMPORT volatile uint32 InterruptHoldoffCount
void GetUserIdAndContext(Oid *userid, bool *sec_def_context)
Oid GetSessionUserId(void)
void pg_bindtextdomain(const char *domain)
void SwitchToSharedLatch(void)
void TouchSocketLockFiles(void)
void SetDataDir(const char *dir)
void SetCurrentRoleId(Oid roleid, bool is_superuser)
pg_stack_base_t set_stack_base(void)
PGDLLIMPORT volatile bool InterruptPending
void pg_split_opts(char **argv, int *argcp, const char *optstr)
void SetSessionAuthorization(Oid userid, bool is_superuser)
int trace_recovery(int trace_level)
void restore_stack_base(pg_stack_base_t base)
PGDLLIMPORT bool IsBinaryUpgrade
void CreateDataDirLockFile(bool amPostmaster)
char * GetUserNameFromId(Oid roleid, bool noerr)
PGDLLIMPORT bool IsUnderPostmaster
void InitializeSessionUserId(const char *rolename, Oid useroid)
PGDLLIMPORT int DateStyle
void ChangeToDataDir(void)
void GetUserIdAndSecContext(Oid *userid, int *sec_context)
PGDLLIMPORT volatile uint32 CritSectionCount
bool RecheckDataDirLockFile(void)
volatile bool ClientConnectionLost
void ProcessInterrupts(void)
PGDLLIMPORT char my_exec_path[]
PGDLLIMPORT Oid MyDatabaseId
PGDLLIMPORT bool process_shared_preload_libraries_in_progress
void PreventCommandDuringRecovery(const char *cmdname)
Oid GetCurrentRoleId(void)
void InitPostmasterChild(void)
PGDLLIMPORT int DateOrder