1 /*-------------------------------------------------------------------------
4 * global variable declarations
6 * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group
7 * Portions Copyright (c) 1994, Regents of the University of California
11 * src/backend/utils/init/globals.c
14 * Globals used all over the place should be declared here and not
17 *-------------------------------------------------------------------------
21 #include "catalog/objectaccess.h"
22 #include "libpq/pqcomm.h"
23 #include "miscadmin.h"
24 #include "storage/backendid.h"
27 ProtocolVersion FrontendProtocol;
29 volatile bool InterruptPending = false;
30 volatile bool QueryCancelPending = false;
31 volatile bool ProcDiePending = false;
32 volatile bool ClientConnectionLost = false;
33 volatile bool ImmediateInterruptOK = false;
34 volatile uint32 InterruptHoldoffCount = 0;
35 volatile uint32 CritSectionCount = 0;
38 pg_time_t MyStartTime;
39 struct Port *MyProcPort;
44 * DataDir is the absolute path to the top level of the PGDATA directory tree.
45 * Except during early startup, this is also the server's working directory;
46 * most code therefore can simply use relative paths and not reference DataDir
51 char OutputFileName[MAXPGPATH]; /* debugging output file */
53 char my_exec_path[MAXPGPATH]; /* full path to my executable */
54 char pkglib_path[MAXPGPATH]; /* full path to lib directory */
57 char postgres_exec_path[MAXPGPATH]; /* full path to backend */
59 /* note: currently this is not valid in backend processes */
62 BackendId MyBackendId = InvalidBackendId;
64 Oid MyDatabaseId = InvalidOid;
66 Oid MyDatabaseTableSpace = InvalidOid;
69 * DatabasePath is the path (relative to DataDir) of my database's
70 * primary directory, ie, its directory in the default tablespace.
72 char *DatabasePath = NULL;
74 pid_t PostmasterPid = 0;
77 * IsPostmasterEnvironment is true in a postmaster process and any postmaster
78 * child process; it is false in a standalone process (bootstrap or
79 * standalone backend). IsUnderPostmaster is true in postmaster child
80 * processes. Note that "child process" includes all children, not only
81 * regular backends. These should be set correctly as early as possible
82 * in the execution of a process, so that error handling will do the right
83 * things if an error should occur during process initialization.
85 * These are initialized for the bootstrap/standalone case.
87 bool IsPostmasterEnvironment = false;
88 bool IsUnderPostmaster = false;
89 bool IsBinaryUpgrade = false;
91 bool ExitOnAnyError = false;
93 int DateStyle = USE_ISO_DATES;
94 int DateOrder = DATEORDER_MDY;
95 int IntervalStyle = INTSTYLE_POSTGRES;
96 bool HasCTZSet = false;
99 bool enableFsync = true;
100 bool allowSystemTableMods = false;
102 int maintenance_work_mem = 16384;
105 * Primary determinants of sizes of shared-memory structures. MaxBackends is
106 * MaxConnections + autovacuum_max_workers + 1 (it is computed by the GUC
107 * assign hooks for those variables):
110 int MaxBackends = 100;
111 int MaxConnections = 90;
113 int VacuumCostPageHit = 1; /* GUC parameters for vacuum */
114 int VacuumCostPageMiss = 10;
115 int VacuumCostPageDirty = 20;
116 int VacuumCostLimit = 200;
117 int VacuumCostDelay = 0;
119 int VacuumPageHit = 0;
120 int VacuumPageMiss = 0;
121 int VacuumPageDirty = 0;
123 int VacuumCostBalance = 0; /* working state for vacuum */
124 bool VacuumCostActive = false;
126 int GinFuzzySearchLimit = 0;
129 * Hook on object accesses. This is intended as infrastructure for security
130 * and logging plugins.
132 object_access_hook_type object_access_hook = NULL;