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/backendid.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 IdleSessionTimeoutPending = false
 
volatile sig_atomic_t ProcSignalBarrierPending = false
 
volatile sig_atomic_t LogMemoryContextPending = false
 
volatile uint32 InterruptHoldoffCount = 0
 
volatile uint32 QueryCancelHoldoffCount = 0
 
volatile uint32 CritSectionCount = 0
 
int MyProcPid
 
pg_time_t MyStartTime
 
TimestampTz MyStartTimestamp
 
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]
 
BackendId MyBackendId = InvalidBackendId
 
BackendId ParallelLeaderBackendId = InvalidBackendId
 
Oid MyDatabaseId = InvalidOid
 
Oid MyDatabaseTableSpace = InvalidOid
 
char * DatabasePath = NULL
 
pid_t PostmasterPid = 0
 
bool IsPostmasterEnvironment = false
 
bool IsUnderPostmaster = false
 
bool IsBinaryUpgrade = false
 
bool IsBackgroundWorker = 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 = 1.0
 
int maintenance_work_mem = 65536
 
int max_parallel_maintenance_workers = 2
 
int NBuffers = 1000
 
int MaxConnections = 90
 
int max_worker_processes = 8
 
int max_parallel_workers = 8
 
int MaxBackends = 0
 
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
 

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().

◆ CritSectionCount

◆ data_directory_mode

int data_directory_mode = PG_DIR_MODE_OWNER

Definition at line 71 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 116 of file globals.c.

Referenced by errstart(), and HandleCheckpointerInterrupts().

◆ FrontendProtocol

◆ hash_mem_multiplier

double hash_mem_multiplier = 1.0

Definition at line 125 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 36 of file globals.c.

Referenced by IdleSessionTimeoutHandler(), and ProcessInterrupts().

◆ InterruptHoldoffCount

volatile uint32 InterruptHoldoffCount = 0

◆ InterruptPending

◆ IntervalStyle

int IntervalStyle = INTSTYLE_POSTGRES

◆ IsBackgroundWorker

◆ IsBinaryUpgrade

◆ IsPostmasterEnvironment

◆ IsUnderPostmaster

bool IsUnderPostmaster = false

Definition at line 112 of file globals.c.

Referenced by _PG_init(), AdvanceNextFullTransactionIdPastXid(), AutoVacuumShmemInit(), AuxiliaryProcessMain(), BackgroundWorkerShmemInit(), bootstrap_signals(), BootstrapModeMain(), BTreeShmemInit(), CheckMyDatabase(), CheckRecoveryConsistency(), CommitTsShmemInit(), compute_parallel_vacuum_workers(), createdb(), CreateLWLocks(), CreateSharedMemoryAndSemaphores(), DebugFileOpen(), dsm_attach(), dsm_create(), dsm_postmaster_startup(), EventTriggerDDLCommandEnd(), EventTriggerDDLCommandStart(), EventTriggerSQLDrop(), EventTriggerTableRewrite(), ForwardSyncRequest(), GetNewMultiXactId(), GetNewTransactionId(), GetQuitSignalReason(), HandleStartupProcInterrupts(), init_ps_display(), InitializeLatchSupport(), InitializeLatchWaitSet(), InitializeSessionUserId(), InitializeSessionUserIdStandalone(), InitPostgres(), InitPostmasterChild(), InitPredicateLocks(), InitProcess(), InitSync(), LWLockAcquire(), MaintainLatestCompletedXidRecovery(), MultiXactShmemInit(), PerformRecoveryXLogAction(), PGSemaphoreCreate(), PGSharedMemoryCreate(), PGSharedMemoryNoReAttach(), PGSharedMemoryReAttach(), pgss_shmem_startup(), plan_create_index_workers(), PostgresMain(), PostgresSingleUserMain(), process_postgres_switches(), process_settings(), ProcKill(), readRecoverySignalFile(), RegisterBackgroundWorker(), RegisterDynamicBackgroundWorker(), ReplicationSlotAcquire(), RequestAddinShmemSpace(), RequestNamedLWLockTranche(), SendPostmasterSignal(), SerialInit(), set_config_option(), set_config_sourcefile(), set_ps_display(), SetMultiXactIdLimit(), SetTransactionIdLimit(), ShmemInitStruct(), SimpleLruInit(), slru_entry(), standard_planner(), start_xact_command(), StartupXLOG(), superuser_arg(), SyncScanShmemInit(), TwoPhaseShmemInit(), verify_dictoptions(), WaitLatch(), WaitLatchOrSocket(), XLogArchiveNotify(), XLogPageRead(), XLogRecGetFullXid(), and XLogWrite().

◆ LogMemoryContextPending

volatile sig_atomic_t LogMemoryContextPending = false

◆ maintenance_work_mem

◆ max_parallel_maintenance_workers

int max_parallel_maintenance_workers = 2

Definition at line 127 of file globals.c.

Referenced by compute_parallel_vacuum_workers(), and plan_create_index_workers().

◆ max_parallel_workers

int max_parallel_workers = 8

Definition at line 138 of file globals.c.

Referenced by RegisterDynamicBackgroundWorker().

◆ max_worker_processes

◆ MaxBackends

◆ MaxConnections

◆ my_exec_path

◆ MyBackendId

◆ MyCancelKey

◆ MyDatabaseId

Oid MyDatabaseId = InvalidOid

Definition at line 88 of file globals.c.

Referenced by AfterTriggerSetState(), AlterDatabase(), AlterObjectRename_internal(), AlterPublicationOwner_internal(), AlterSchemaOwner_internal(), AlterSubscription(), AlterSubscriptionOwner(), asyncQueueNotificationToEntry(), asyncQueueProcessPageEntries(), ATExecDetachPartition(), AutoVacuumRequestWork(), backend_read_statsfile(), CacheInvalidateCatalog(), CacheInvalidateHeapTuple(), CacheInvalidateRelcache(), CacheInvalidateRelcacheByTuple(), check_default_table_access_method(), check_default_tablespace(), check_temp_tablespaces(), check_TSCurrentConfig(), 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(), Exec_ListenPreCommit(), exec_object_restorecon(), exec_replication_command(), ExecuteTruncateGuts(), ExpandColumnRefStar(), ExportSnapshot(), extension_is_trusted(), get_subscription_oid(), GetCurrentVirtualXIDs(), GetNewRelFileNode(), heap_vacuum_rel(), IdentifySystem(), ImportSnapshot(), initialize_acl(), InitializeParallelDSM(), InitPostgres(), InitTempTableNamespace(), lazy_check_wraparound_failsafe(), libpqrcv_exec(), LocalExecuteInvalidationMessage(), 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(), movedb(), perform_relmap_update(), perform_work_item(), pg_namespace_aclmask(), pg_relation_filepath(), pgss_store(), pgstat_bestart(), pgstat_drop_database(), pgstat_fetch_stat_funcentry(), pgstat_fetch_stat_tabentry(), pgstat_report_analyze(), pgstat_report_checksum_failure(), pgstat_report_connect(), pgstat_report_deadlock(), pgstat_report_disconnect(), pgstat_report_recovery_conflict(), pgstat_report_stat(), pgstat_report_tempfile(), pgstat_report_vacuum(), pgstat_reset_counters(), pgstat_reset_single_counter(), pgstat_send_funcstats(), pgstat_shutdown_hook(), pgstat_vacuum_stat(), PostgresMain(), PrepareToInvalidateCacheTuple(), PrepareTransaction(), ProcArrayInstallImportedXmin(), ProcArrayInstallRestoredXmin(), RangeVarGetAndCheckCreationNamespace(), RangeVarGetCreationNamespace(), RangeVarGetRelidExtended(), recheck_relation_needs_vacanalyze(), ReindexMultipleTables(), RelationInitLockInfo(), RelationInitPhysicalAddr(), RelationMapFinishBootstrap(), RenameDatabase(), RenameSchema(), ReplicationSlotCreate(), roles_is_member_of(), ScanPgRelation(), sepgsql_schema_post_create(), SetLocktagRelationOid(), shdepDropOwned(), shdepReassignOwned(), SignalBackends(), transformColumnRef(), UnlockDatabaseObject(), UpdateLogicalMappings(), vac_truncate_clog(), vac_update_datfrozenxid(), vacuum_is_relation_owner(), XactLogAbortRecord(), and XactLogCommitRecord().

◆ MyDatabaseTableSpace

◆ MyLatch

struct Latch* MyLatch

Definition at line 57 of file globals.c.

Referenced by ApplyLauncherMain(), autoprewarm_main(), AutoVacLauncherMain(), avl_sigusr2_handler(), BackgroundWriterMain(), be_tls_open_server(), CheckDeadLockAlert(), CheckpointerMain(), ClientCheckTimeoutHandler(), ConditionVariableTimedSleep(), copy_read_data(), die(), do_pg_stop_backup(), gather_readnext(), handle_sig_alarm(), HandleCatchupInterrupt(), HandleNotifyInterrupt(), HandleParallelMessageInterrupt(), IdleInTransactionSessionTimeoutHandler(), IdleSessionTimeoutHandler(), initialize_worker_spi(), InitializeLatchWaitSet(), InitPostmasterChild(), InitStandaloneProcess(), lazy_truncate_heap(), libpqrcv_connect(), libpqrcv_PQgetResult(), logicalrep_worker_stop(), LogicalRepApplyLoop(), mq_putmessage(), pg_promote(), pg_sleep(), pg_wait_until_termination(), pgarch_MainLoop(), pgarch_waken_stop(), pgfdw_get_cleanup_result(), pgfdw_get_result(), PgstatCollectorMain(), pq_init(), ProcessClientReadInterrupt(), ProcessClientWriteInterrupt(), procsignal_sigusr1_handler(), ProcSleep(), ProcWaitForSignal(), read_or_wait(), RecoveryConflictInterrupt(), ReqCheckpointHandler(), secure_open_gssapi(), secure_read(), secure_write(), shm_mq_receive_bytes(), shm_mq_send_bytes(), shm_mq_wait_internal(), SignalHandlerForConfigReload(), SignalHandlerForShutdownRequest(), sigUsr1Handler(), StatementCancelHandler(), SwitchBackToLocalLatch(), SwitchToSharedLatch(), SyncRepWaitForLSN(), SysLoggerMain(), test_shm_mq_pipelined(), throttle(), vacuum_delay_point(), wait_for_relation_state_change(), wait_for_worker_state_change(), wait_for_workers_to_become_ready(), WaitForBackgroundWorkerShutdown(), WaitForBackgroundWorkerStartup(), WaitForParallelWorkersToAttach(), WaitForParallelWorkersToFinish(), WaitForReplicationWorkerAttach(), WalRcvWaitForStartPosition(), WalReceiverMain(), WalSndLastCycleHandler(), WalSndLoop(), WalSndWaitForWal(), WalSndWriteData(), WalWriterMain(), and write_syslogger_file().

◆ MyPMChildSlot

◆ MyProcPid

int MyProcPid

Definition at line 43 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(), AutoVacLauncherMain(), BackendRun(), CheckpointerMain(), CleanupProcSignalState(), DisownLatch(), drandom(), Exec_ListenPreCommit(), Exec_UnlistenAllCommit(), Exec_UnlistenCommit(), ExportSnapshot(), FileSetInit(), GetSerializableTransactionSnapshotInt(), HandleWalSndInitStopping(), InitAuxiliaryProcess(), InitializeLatchSupport(), InitializeParallelDSM(), InitLatch(), InitPostmasterDeathWatchHandle(), InitProcess(), InitProcessGlobals(), InitWalSenderSlot(), InvalidatePossiblyObsoleteSlot(), IsLogicalLauncher(), LaunchParallelWorkers(), llvm_compile_module(), LockBufferForCleanup(), LockTimeoutHandler(), log_line_prefix(), logicalrep_worker_launch(), ModifyWaitEvent(), OpenTemporaryFileInTablespace(), OwnLatch(), ParallelWorkerMain(), pg_backend_pid(), pgstat_bestart(), PostgresMain(), PostmasterMain(), ProcessLogMemoryContextInterrupt(), ProcSignalInit(), ProcSleep(), PublishStartupProcessInformation(), ReplicationOriginExitCleanup(), ReplicationSlotAcquire(), ReplicationSlotCleanup(), ReplicationSlotCreate(), ReplicationSlotsDropDBSlots(), replorigin_session_setup(), ResetLatch(), ServerLoop(), set_ps_display(), SetLatch(), setup_background_workers(), SharedInvalBackendInit(), SignalBackends(), SnapBuildSerialize(), StatementTimeoutHandler(), UnlockBuffers(), WalRcvDie(), WalReceiverMain(), worker_spi_launch(), write_csvlog(), write_pipe_chunks(), and write_relcache_init_file().

◆ MyProcPort

◆ MyStartTime

◆ MyStartTimestamp

TimestampTz MyStartTimestamp

◆ NBuffers

◆ OutputFileName

char OutputFileName[MAXPGPATH]

Definition at line 73 of file globals.c.

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

◆ ParallelLeaderBackendId

BackendId ParallelLeaderBackendId = InvalidBackendId

Definition at line 86 of file globals.c.

Referenced by ParallelWorkerMain(), and ParallelWorkerShutdown().

◆ pkglib_path

◆ PostmasterPid

◆ ProcDiePending

◆ ProcSignalBarrierPending

◆ QueryCancelHoldoffCount

volatile uint32 QueryCancelHoldoffCount = 0

Definition at line 40 of file globals.c.

Referenced by errfinish(), and ProcessInterrupts().

◆ QueryCancelPending

◆ VacuumCostActive

◆ VacuumCostBalance

◆ VacuumCostDelay

◆ VacuumCostLimit

◆ VacuumCostPageDirty

int VacuumCostPageDirty = 20

Definition at line 143 of file globals.c.

Referenced by MarkBufferDirty(), and MarkBufferDirtyHint().

◆ VacuumCostPageHit

int VacuumCostPageHit = 1

Definition at line 141 of file globals.c.

Referenced by ReadBuffer_common().

◆ VacuumCostPageMiss

int VacuumCostPageMiss = 2

Definition at line 142 of file globals.c.

Referenced by ReadBuffer_common().

◆ VacuumPageDirty

int64 VacuumPageDirty = 0

◆ VacuumPageHit

int64 VacuumPageHit = 0

◆ VacuumPageMiss

int64 VacuumPageMiss = 0

◆ work_mem

int work_mem = 4096

Definition at line 124 of file globals.c.

Referenced by _bt_parallel_scan_and_sort(), _bt_pendingfsm_init(), _bt_spools_heapscan(), adjust_foreign_grouping_path_cost(), begin_partition(), brin_page_items(), choose_hashed_setop(), collectMatchBitmap(), compute_bitmap_pages(), connectby(), cost_append(), cost_material(), cost_rescan(), create_gather_merge_path(), create_groupingsets_path(), create_incremental_sort_path(), create_merge_append_path(), create_sort_path(), create_unique_path(), CreateWorkExprContext(), crosstab(), dblink_get_notify(), deflist_to_tuplestore(), each_worker(), each_worker_jsonb(), elements_worker(), elements_worker_jsonb(), exec_init_tuple_store(), ExecIncrementalSort(), ExecInitCteScan(), ExecInitRecursiveUnion(), ExecMakeTableFunctionResult(), ExecMaterial(), ExecRecursiveUnion(), ExecSort(), final_cost_mergejoin(), fmgr_sql(), get_crosstab_tuplestore(), get_hash_memory_limit(), GetCurrentFDWTuplestore(), ginInsertCleanup(), gist_page_items(), gist_page_items_bytea(), initial_cost_mergejoin(), initialize_aggregate(), initialize_phase(), label_sort_with_costsize(), libpqrcv_processTuples(), MakeTransitionCaptureState(), materializeResult(), MultiExecBitmapIndexScan(), MultiExecBitmapOr(), ordered_set_startup(), pg_available_extension_versions(), pg_available_extensions(), pg_config(), pg_cursor(), pg_event_trigger_ddl_commands(), pg_event_trigger_dropped_objects(), pg_extension_update_paths(), pg_get_backend_memory_contexts(), pg_get_replication_slots(), pg_get_shmem_allocations(), pg_hba_file_rules(), pg_logdir_ls_internal(), pg_logical_slot_get_changes_guts(), pg_ls_dir(), pg_ls_dir_files(), pg_prepared_statement(), pg_show_replication_origin_status(), pg_stat_get_activity(), pg_stat_get_progress_info(), pg_stat_get_slru(), pg_stat_get_subscription(), pg_stat_get_wal_senders(), pg_stat_statements_internal(), pg_stop_backup_v2(), pg_tablespace_databases(), pg_timezone_names(), pgrowlocks(), plperl_return_next_internal(), pltcl_init_tuple_store(), populate_recordset_worker(), PortalCreateHoldStore(), postgres_fdw_get_connections(), show_all_file_settings(), storeRow(), switchToPresortedPrefixMode(), text_to_table(), tfuncFetchRows(), verify_heapam(), and xpath_table().