PostgreSQL Source Code  git master
globals.c File Reference
#include "postgres.h"
#include "common/file_perm.h"
#include "libpq/libpq-be.h"
#include "libpq/pqcomm.h"
#include "miscadmin.h"
#include "storage/procnumber.h"
Include dependency graph for globals.c:

Go to the source code of this file.

Variables

ProtocolVersion FrontendProtocol
 
volatile sig_atomic_t InterruptPending = false
 
volatile sig_atomic_t QueryCancelPending = false
 
volatile sig_atomic_t ProcDiePending = false
 
volatile sig_atomic_t CheckClientConnectionPending = false
 
volatile sig_atomic_t ClientConnectionLost = false
 
volatile sig_atomic_t IdleInTransactionSessionTimeoutPending = false
 
volatile sig_atomic_t TransactionTimeoutPending = false
 
volatile sig_atomic_t IdleSessionTimeoutPending = false
 
volatile sig_atomic_t ProcSignalBarrierPending = false
 
volatile sig_atomic_t LogMemoryContextPending = false
 
volatile sig_atomic_t IdleStatsUpdateTimeoutPending = false
 
volatile uint32 InterruptHoldoffCount = 0
 
volatile uint32 QueryCancelHoldoffCount = 0
 
volatile uint32 CritSectionCount = 0
 
int MyProcPid
 
pg_time_t MyStartTime
 
TimestampTz MyStartTimestamp
 
struct ClientSocketMyClientSocket
 
struct PortMyProcPort
 
int32 MyCancelKey
 
int MyPMChildSlot
 
struct LatchMyLatch
 
char * DataDir = NULL
 
int data_directory_mode = PG_DIR_MODE_OWNER
 
char OutputFileName [MAXPGPATH]
 
char my_exec_path [MAXPGPATH]
 
char pkglib_path [MAXPGPATH]
 
ProcNumber MyProcNumber = INVALID_PROC_NUMBER
 
ProcNumber ParallelLeaderProcNumber = INVALID_PROC_NUMBER
 
Oid MyDatabaseId = InvalidOid
 
Oid MyDatabaseTableSpace = InvalidOid
 
bool MyDatabaseHasLoginEventTriggers = false
 
char * DatabasePath = NULL
 
pid_t PostmasterPid = 0
 
bool IsPostmasterEnvironment = false
 
bool IsUnderPostmaster = false
 
bool IsBinaryUpgrade = false
 
bool ExitOnAnyError = false
 
int DateStyle = USE_ISO_DATES
 
int DateOrder = DATEORDER_MDY
 
int IntervalStyle = INTSTYLE_POSTGRES
 
bool enableFsync = true
 
bool allowSystemTableMods = false
 
int work_mem = 4096
 
double hash_mem_multiplier = 2.0
 
int maintenance_work_mem = 65536
 
int max_parallel_maintenance_workers = 2
 
int NBuffers = 16384
 
int MaxConnections = 100
 
int max_worker_processes = 8
 
int max_parallel_workers = 8
 
int MaxBackends = 0
 
int VacuumBufferUsageLimit = 256
 
int VacuumCostPageHit = 1
 
int VacuumCostPageMiss = 2
 
int VacuumCostPageDirty = 20
 
int VacuumCostLimit = 200
 
double VacuumCostDelay = 0
 
int64 VacuumPageHit = 0
 
int64 VacuumPageMiss = 0
 
int64 VacuumPageDirty = 0
 
int VacuumCostBalance = 0
 
bool VacuumCostActive = false
 
int commit_timestamp_buffers = 0
 
int multixact_member_buffers = 32
 
int multixact_offset_buffers = 16
 
int notify_buffers = 16
 
int serializable_buffers = 32
 
int subtransaction_buffers = 0
 
int transaction_buffers = 0
 

Variable Documentation

◆ allowSystemTableMods

◆ CheckClientConnectionPending

volatile sig_atomic_t CheckClientConnectionPending = false

Definition at line 33 of file globals.c.

Referenced by ClientCheckTimeoutHandler(), and ProcessInterrupts().

◆ ClientConnectionLost

volatile sig_atomic_t ClientConnectionLost = false

Definition at line 34 of file globals.c.

Referenced by internal_flush(), and ProcessInterrupts().

◆ commit_timestamp_buffers

int commit_timestamp_buffers = 0

Definition at line 162 of file globals.c.

Referenced by CommitTsShmemBuffers(), and CommitTsShmemInit().

◆ CritSectionCount

◆ data_directory_mode

int data_directory_mode = PG_DIR_MODE_OWNER

Definition at line 74 of file globals.c.

Referenced by checkDataDir(), RetrieveDataDirCreatePerm(), and show_data_directory_mode().

◆ DatabasePath

◆ DataDir

◆ DateOrder

int DateOrder = DATEORDER_MDY

◆ DateStyle

◆ enableFsync

◆ ExitOnAnyError

bool ExitOnAnyError = false

Definition at line 120 of file globals.c.

Referenced by errstart(), and HandleCheckpointerInterrupts().

◆ FrontendProtocol

◆ hash_mem_multiplier

double hash_mem_multiplier = 2.0

Definition at line 129 of file globals.c.

Referenced by get_hash_memory_limit().

◆ IdleInTransactionSessionTimeoutPending

volatile sig_atomic_t IdleInTransactionSessionTimeoutPending = false

Definition at line 35 of file globals.c.

Referenced by IdleInTransactionSessionTimeoutHandler(), and ProcessInterrupts().

◆ IdleSessionTimeoutPending

volatile sig_atomic_t IdleSessionTimeoutPending = false

Definition at line 37 of file globals.c.

Referenced by IdleSessionTimeoutHandler(), and ProcessInterrupts().

◆ IdleStatsUpdateTimeoutPending

volatile sig_atomic_t IdleStatsUpdateTimeoutPending = false

Definition at line 40 of file globals.c.

Referenced by IdleStatsUpdateTimeoutHandler(), and ProcessInterrupts().

◆ InterruptHoldoffCount

◆ InterruptPending

◆ IntervalStyle

int IntervalStyle = INTSTYLE_POSTGRES

◆ IsBinaryUpgrade

◆ IsPostmasterEnvironment

◆ IsUnderPostmaster

bool IsUnderPostmaster = false

Definition at line 117 of file globals.c.

Referenced by _PG_init(), AdvanceNextFullTransactionIdPastXid(), AutoVacuumShmemInit(), AuxiliaryProcessMainCommon(), BackgroundWorkerShmemInit(), bootstrap_signals(), BootstrapModeMain(), BTreeShmemInit(), CheckMyDatabase(), CheckRecoveryConsistency(), CommitTsShmemInit(), createdb(), CreateLWLocks(), CreateOrAttachShmemStructs(), CreateRestartPoint(), CreateSharedMemoryAndSemaphores(), DebugFileOpen(), dsm_attach(), dsm_backend_startup(), dsm_create(), dsm_impl_pin_segment(), dsm_impl_posix_resize(), dsm_impl_unpin_segment(), dsm_postmaster_startup(), EventTriggerDDLCommandEnd(), EventTriggerDDLCommandStart(), EventTriggerOnLogin(), EventTriggerSQLDrop(), EventTriggerTableRewrite(), ForwardSyncRequest(), get_slru_entry(), GetNewMultiXactId(), GetNewTransactionId(), GetQuitSignalReason(), HandleStartupProcInterrupts(), init_ps_display(), InitAuxiliaryProcess(), InitializeLatchSupport(), InitializeLatchWaitSet(), InitializeSessionUserId(), InitializeSessionUserIdStandalone(), InitPostgres(), InitPostmasterChild(), InitPredicateLocks(), InitProcess(), InitSync(), LWLockAcquire(), MaintainLatestCompletedXidRecovery(), MultiXactShmemInit(), parallel_vacuum_compute_workers(), PerformRecoveryXLogAction(), PerformWalRecovery(), PGSemaphoreCreate(), PGSharedMemoryNoReAttach(), PGSharedMemoryReAttach(), pgss_shmem_startup(), pgstat_fetch_entry(), pgstat_flush_wal(), pgstat_read_statsfile(), pgstat_report_autovac(), pgstat_report_recovery_conflict(), pgstat_shutdown_hook(), plan_create_index_workers(), PostgresMain(), PostgresSingleUserMain(), postmaster_child_launch(), process_postgres_switches(), process_settings(), ProcessConfigFileInternal(), ProcKill(), readRecoverySignalFile(), RegisterBackgroundWorker(), RegisterDynamicBackgroundWorker(), ReplicationSlotAcquire(), SendPostmasterSignal(), SerialInit(), set_config_sourcefile(), set_config_with_handle(), SetMultiXactIdLimit(), SetTransactionIdLimit(), ShmemInitStruct(), SimpleLruInit(), standard_planner(), start_xact_command(), StatsShmemInit(), superuser_arg(), SyncScanShmemInit(), TwoPhaseShmemInit(), vacuum_delay_point(), VarsupShmemInit(), verify_dictoptions(), WaitLatch(), WaitLatchOrSocket(), XLogArchiveNotify(), XLogPageRead(), XLogPrefetchIncrement(), XLogRecGetFullXid(), and XLogWrite().

◆ LogMemoryContextPending

◆ maintenance_work_mem

◆ max_parallel_maintenance_workers

int max_parallel_maintenance_workers = 2

Definition at line 131 of file globals.c.

Referenced by parallel_vacuum_compute_workers(), and plan_create_index_workers().

◆ max_parallel_workers

int max_parallel_workers = 8

Definition at line 142 of file globals.c.

Referenced by RegisterDynamicBackgroundWorker().

◆ max_worker_processes

◆ MaxBackends

◆ MaxConnections

◆ multixact_member_buffers

int multixact_member_buffers = 32

Definition at line 163 of file globals.c.

Referenced by MultiXactShmemInit(), and MultiXactShmemSize().

◆ multixact_offset_buffers

int multixact_offset_buffers = 16

Definition at line 164 of file globals.c.

Referenced by MultiXactShmemInit(), and MultiXactShmemSize().

◆ my_exec_path

◆ MyCancelKey

int32 MyCancelKey

◆ MyClientSocket

struct ClientSocket* MyClientSocket

Definition at line 48 of file globals.c.

Referenced by BackendMain(), and postmaster_child_launch().

◆ MyDatabaseHasLoginEventTriggers

bool MyDatabaseHasLoginEventTriggers = false

Definition at line 95 of file globals.c.

Referenced by EventTriggerOnLogin(), and InitPostgres().

◆ MyDatabaseId

Oid MyDatabaseId = InvalidOid

Definition at line 91 of file globals.c.

Referenced by AfterTriggerSetState(), AlterDatabase(), AlterObjectRename_internal(), AlterPublicationOwner_internal(), AlterSchemaOwner_internal(), AlterSubscription(), AlterSubscriptionOwner(), AlterSubscriptionOwner_internal(), asyncQueueNotificationToEntry(), asyncQueueProcessPageEntries(), ATExecDetachPartition(), AutoVacuumRequestWork(), CacheInvalidateCatalog(), CacheInvalidateHeapTuple(), CacheInvalidateRelcache(), CacheInvalidateRelcacheByTuple(), check_default_table_access_method(), check_default_tablespace(), check_default_text_search_config(), check_temp_tablespaces(), CheckLogicalDecodingRequirements(), CheckMyDatabase(), checkSharedDependencies(), checkTempNamespaceStatus(), classIdGetDbId(), ComputeXidHorizons(), CreateDecodingContext(), CreateInitDecodingContext(), CreatePublication(), CreateSchemaCommand(), CreateSubscription(), current_database(), database_to_xml_internal(), DeconstructQualifiedName(), do_analyze_rel(), do_autovacuum(), dropdb(), DropSubscription(), EventTriggerOnLogin(), Exec_ListenPreCommit(), exec_object_restorecon(), exec_replication_command(), ExecuteTruncateGuts(), ExpandColumnRefStar(), ExportSnapshot(), extension_is_trusted(), find_funcstat_entry(), find_tabstat_entry(), get_subscription_oid(), GetCurrentVirtualXIDs(), GetNewRelFileNumber(), GetRunningTransactionData(), heap_vacuum_rel(), IdentifySystem(), ImportSnapshot(), initialize_acl(), InitializeParallelDSM(), InitPostgres(), InitTempTableNamespace(), InitWalSenderSlot(), libpqrcv_exec(), LocalExecuteInvalidationMessage(), LockApplyTransactionForSession(), LockDatabaseFrozenIds(), LockDatabaseObject(), LockGXact(), logical_heap_rewrite_flush_mappings(), logical_rewrite_log_mapping(), LogLogicalMessage(), LogStandbyInvalidations(), map_sql_catalog_to_xmlschema_types(), map_sql_schema_to_xmlschema_types(), map_sql_table_to_xmlschema(), map_sql_type_to_xml_name(), match_db_entries(), movedb(), perform_relmap_update(), perform_work_item(), pg_collation_actual_version(), pg_namespace_aclmask_ext(), pg_relation_filepath(), pg_stat_reset_single_function_counters(), pg_stat_reset_single_table_counters(), pgss_store(), pgstat_bestart(), pgstat_build_snapshot(), pgstat_copy_relation_stats(), pgstat_create_function(), pgstat_create_relation(), pgstat_drop_function(), pgstat_drop_relation(), pgstat_fetch_stat_funcentry(), pgstat_fetch_stat_tabentry_ext(), pgstat_init_function_usage(), pgstat_prep_database_pending(), pgstat_prep_relation_pending(), pgstat_report_analyze(), pgstat_report_checksum_failure(), pgstat_report_connect(), pgstat_report_deadlock(), pgstat_report_disconnect(), pgstat_report_recovery_conflict(), pgstat_report_tempfile(), pgstat_report_vacuum(), pgstat_reset_counters(), pgstat_reset_database_timestamp(), pgstat_shutdown_hook(), pgstat_update_dbstats(), PostgresMain(), PrepareToInvalidateCacheTuple(), PrepareTransaction(), ProcArrayInstallImportedXmin(), ProcArrayInstallRestoredXmin(), RangeVarGetAndCheckCreationNamespace(), RangeVarGetCreationNamespace(), RangeVarGetRelidExtended(), ReindexMultipleTables(), RelationInitLockInfo(), RelationInitPhysicalAddr(), RelationMapFinishBootstrap(), RenameDatabase(), RenameSchema(), ReplicationSlotCreate(), roles_is_member_of(), ScanPgRelation(), sepgsql_schema_post_create(), SetDatatabaseHasLoginEventTriggers(), SetLocktagRelationOid(), shdepDropOwned(), shdepReassignOwned(), SignalBackends(), transformColumnRef(), UnlockApplyTransactionForSession(), UnlockDatabaseObject(), UpdateLogicalMappings(), vac_truncate_clog(), vac_update_datfrozenxid(), vacuum_is_permitted_for_relation(), XactLogAbortRecord(), and XactLogCommitRecord().

◆ MyDatabaseTableSpace

◆ MyLatch

struct Latch* MyLatch

Definition at line 60 of file globals.c.

Referenced by ApplyLauncherMain(), autoprewarm_main(), avl_sigusr2_handler(), BackgroundWriterMain(), be_tls_open_server(), CheckDeadLockAlert(), CheckpointerMain(), CheckpointWriteDelay(), ClientCheckTimeoutHandler(), ConditionVariableTimedSleep(), ConfigurePostmasterWaitSet(), copy_read_data(), die(), do_pg_backup_stop(), gather_readnext(), handle_pm_child_exit_signal(), handle_pm_pmsignal_signal(), handle_pm_reload_request_signal(), handle_pm_shutdown_request_signal(), handle_sig_alarm(), HandleCatchupInterrupt(), HandleNotifyInterrupt(), HandleParallelApplyMessageInterrupt(), HandleParallelMessageInterrupt(), IdleInTransactionSessionTimeoutHandler(), IdleSessionTimeoutHandler(), IdleStatsUpdateTimeoutHandler(), InitializeLatchWaitSet(), InitProcessLocalLatch(), lazy_truncate_heap(), libpqrcv_connect(), libpqrcv_PQgetResult(), libpqsrv_connect_internal(), libpqsrv_get_result(), LogicalParallelApplyLoop(), logicalrep_worker_stop_internal(), LogicalRepApplyLoop(), mq_putmessage(), pa_send_data(), pa_wait_for_xact_state(), pg_promote(), pg_sleep(), pg_wait_until_termination(), pgarch_MainLoop(), pgarch_waken_stop(), pgfdw_get_cleanup_result(), pq_check_connection(), pq_init(), ProcessClientReadInterrupt(), ProcessClientWriteInterrupt(), ProcessPendingWrites(), procsignal_sigusr1_handler(), ProcSleep(), ProcWaitForSignal(), read_or_wait(), ReqCheckpointHandler(), secure_open_gssapi(), secure_read(), secure_write(), ServerLoop(), shm_mq_receive_bytes(), shm_mq_send_bytes(), shm_mq_wait_internal(), ShutDownSlotSync(), SignalHandlerForConfigReload(), SignalHandlerForShutdownRequest(), sigUsr1Handler(), StatementCancelHandler(), summarizer_wait_for_wal(), SwitchBackToLocalLatch(), SwitchToSharedLatch(), SyncRepWaitForLSN(), SysLoggerMain(), test_shm_mq_pipelined(), throttle(), TransactionTimeoutHandler(), wait_for_relation_state_change(), wait_for_slot_activity(), wait_for_worker_state_change(), wait_for_workers_to_become_ready(), WaitForBackgroundWorkerShutdown(), WaitForBackgroundWorkerStartup(), WaitForParallelWorkersToAttach(), WaitForParallelWorkersToFinish(), WaitForReplicationWorkerAttach(), WalRcvWaitForStartPosition(), WalReceiverMain(), WalSndLastCycleHandler(), WalSndLoop(), WalSndWaitForWal(), WalSummarizerMain(), WalWriterMain(), and worker_spi_main().

◆ MyPMChildSlot

◆ MyProcNumber

◆ MyProcPid

int MyProcPid

Definition at line 45 of file globals.c.

Referenced by AddWaitEventToSet(), ApplyLauncherMain(), apw_detach_shmem(), apw_dump_now(), apw_load_buffers(), apw_start_database_worker(), apw_start_leader_worker(), Async_Listen(), Async_Unlisten(), Async_UnlistenAll(), asyncQueueNotificationToEntry(), asyncQueueReadAllNotifications(), autoprewarm_main(), basic_archive_file_internal(), CheckpointerMain(), CleanupProcSignalState(), DisownLatch(), Exec_ListenPreCommit(), Exec_UnlistenAllCommit(), Exec_UnlistenCommit(), ExportSnapshot(), FileSetInit(), get_backend_type_for_log(), GetSerializableTransactionSnapshotInt(), HandleWalSndInitStopping(), InitAuxiliaryProcess(), initialize_drandom_seed(), InitializeLatchSupport(), InitializeParallelDSM(), InitLatch(), InitPostmasterDeathWatchHandle(), InitProcess(), InitProcessGlobals(), InitWalSenderSlot(), InvalidatePossiblyObsoleteSlot(), IsLogicalLauncher(), LaunchParallelWorkers(), llvm_compile_module(), LockTimeoutHandler(), log_status_format(), logicalrep_worker_launch(), ModifyWaitEvent(), OpenTemporaryFileInTablespace(), OwnLatch(), pg_backend_pid(), pgstat_bestart(), PostgresMain(), PostmasterMain(), proc_exit(), process_pgfdw_appname(), ProcessLogMemoryContextInterrupt(), ProcSignalInit(), ProcSleep(), ReplicationOriginExitCleanup(), ReplicationSlotAcquire(), ReplicationSlotCleanup(), ReplicationSlotCreate(), ReplicationSlotsDropDBSlots(), replorigin_session_setup(), ReplSlotSyncWorkerMain(), ResetLatch(), ServerLoop(), SetLatch(), setup_background_workers(), SharedInvalBackendInit(), SignalBackends(), SnapBuildSerialize(), StatementTimeoutHandler(), WalRcvDie(), WalReceiverMain(), worker_spi_launch(), write_csvlog(), write_jsonlog(), write_pipe_chunks(), and write_relcache_init_file().

◆ MyProcPort

◆ MyStartTime

◆ MyStartTimestamp

TimestampTz MyStartTimestamp

◆ NBuffers

◆ notify_buffers

int notify_buffers = 16

Definition at line 165 of file globals.c.

Referenced by AsyncShmemInit(), and AsyncShmemSize().

◆ OutputFileName

char OutputFileName[MAXPGPATH]

Definition at line 76 of file globals.c.

Referenced by BootstrapModeMain(), DebugFileOpen(), and process_postgres_switches().

◆ ParallelLeaderProcNumber

ProcNumber ParallelLeaderProcNumber = INVALID_PROC_NUMBER

Definition at line 89 of file globals.c.

Referenced by ParallelWorkerMain(), and ParallelWorkerShutdown().

◆ pkglib_path

◆ PostmasterPid

◆ ProcDiePending

volatile sig_atomic_t ProcDiePending = false

◆ ProcSignalBarrierPending

◆ QueryCancelHoldoffCount

volatile uint32 QueryCancelHoldoffCount = 0

Definition at line 42 of file globals.c.

Referenced by errfinish(), ProcessInterrupts(), and ProcessRecoveryConflictInterrupt().

◆ QueryCancelPending

volatile sig_atomic_t QueryCancelPending = false

◆ serializable_buffers

int serializable_buffers = 32

Definition at line 166 of file globals.c.

Referenced by PredicateLockShmemSize(), and SerialInit().

◆ subtransaction_buffers

int subtransaction_buffers = 0

Definition at line 167 of file globals.c.

Referenced by SUBTRANSShmemBuffers(), and SUBTRANSShmemInit().

◆ transaction_buffers

int transaction_buffers = 0

Definition at line 168 of file globals.c.

Referenced by CLOGShmemBuffers(), and CLOGShmemInit().

◆ TransactionTimeoutPending

volatile sig_atomic_t TransactionTimeoutPending = false

Definition at line 36 of file globals.c.

Referenced by ProcessInterrupts(), and TransactionTimeoutHandler().

◆ VacuumBufferUsageLimit

int VacuumBufferUsageLimit = 256

Definition at line 146 of file globals.c.

Referenced by do_autovacuum(), and ExecVacuum().

◆ VacuumCostActive

◆ VacuumCostBalance

◆ VacuumCostDelay

double VacuumCostDelay = 0

Definition at line 152 of file globals.c.

Referenced by VacuumUpdateCosts().

◆ VacuumCostLimit

int VacuumCostLimit = 200

Definition at line 151 of file globals.c.

Referenced by AutoVacuumUpdateCostLimit(), and VacuumUpdateCosts().

◆ VacuumCostPageDirty

int VacuumCostPageDirty = 20

Definition at line 150 of file globals.c.

Referenced by MarkBufferDirty(), and MarkBufferDirtyHint().

◆ VacuumCostPageHit

int VacuumCostPageHit = 1

Definition at line 148 of file globals.c.

Referenced by ReadBuffer_common().

◆ VacuumCostPageMiss

int VacuumCostPageMiss = 2

Definition at line 149 of file globals.c.

Referenced by ReadBuffer_common().

◆ VacuumPageDirty

int64 VacuumPageDirty = 0

◆ VacuumPageHit

int64 VacuumPageHit = 0

◆ VacuumPageMiss

int64 VacuumPageMiss = 0

◆ work_mem