1 /*-------------------------------------------------------------------------
4 * global variable declarations
6 * Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
7 * Portions Copyright (c) 1994, Regents of the University of California
11 * $PostgreSQL: pgsql/src/backend/utils/init/globals.c,v 1.107 2009/01/01 17:23:51 momjian Exp $
14 * Globals used all over the place should be declared here and not
17 *-------------------------------------------------------------------------
21 #include "libpq/pqcomm.h"
22 #include "miscadmin.h"
23 #include "storage/backendid.h"
26 ProtocolVersion FrontendProtocol = PG_PROTOCOL_LATEST;
28 volatile bool InterruptPending = false;
29 volatile bool QueryCancelPending = false;
30 volatile bool ProcDiePending = false;
31 volatile bool ImmediateInterruptOK = false;
32 volatile uint32 InterruptHoldoffCount = 0;
33 volatile uint32 CritSectionCount = 0;
36 pg_time_t MyStartTime;
37 struct Port *MyProcPort;
41 * DataDir is the absolute path to the top level of the PGDATA directory tree.
42 * Except during early startup, this is also the server's working directory;
43 * most code therefore can simply use relative paths and not reference DataDir
48 char OutputFileName[MAXPGPATH]; /* debugging output file */
50 char my_exec_path[MAXPGPATH]; /* full path to my executable */
51 char pkglib_path[MAXPGPATH]; /* full path to lib directory */
54 char postgres_exec_path[MAXPGPATH]; /* full path to backend */
56 /* note: currently this is not valid in backend processes */
59 BackendId MyBackendId = InvalidBackendId;
61 Oid MyDatabaseId = InvalidOid;
63 Oid MyDatabaseTableSpace = InvalidOid;
66 * DatabasePath is the path (relative to DataDir) of my database's
67 * primary directory, ie, its directory in the default tablespace.
69 char *DatabasePath = NULL;
71 pid_t PostmasterPid = 0;
74 * IsPostmasterEnvironment is true in a postmaster process and any postmaster
75 * child process; it is false in a standalone process (bootstrap or
76 * standalone backend). IsUnderPostmaster is true in postmaster child
77 * processes. Note that "child process" includes all children, not only
78 * regular backends. These should be set correctly as early as possible
79 * in the execution of a process, so that error handling will do the right
80 * things if an error should occur during process initialization.
82 * These are initialized for the bootstrap/standalone case.
84 bool IsPostmasterEnvironment = false;
85 bool IsUnderPostmaster = false;
87 bool ExitOnAnyError = false;
89 int DateStyle = USE_ISO_DATES;
90 int DateOrder = DATEORDER_MDY;
91 int IntervalStyle = INTSTYLE_POSTGRES;
92 bool HasCTZSet = false;
95 bool enableFsync = true;
96 bool allowSystemTableMods = false;
98 int maintenance_work_mem = 16384;
101 * Primary determinants of sizes of shared-memory structures. MaxBackends is
102 * MaxConnections + autovacuum_max_workers (it is computed by the GUC assign
106 int MaxBackends = 100;
107 int MaxConnections = 90;
109 int VacuumCostPageHit = 1; /* GUC parameters for vacuum */
110 int VacuumCostPageMiss = 10;
111 int VacuumCostPageDirty = 20;
112 int VacuumCostLimit = 200;
113 int VacuumCostDelay = 0;
115 int VacuumCostBalance = 0; /* working state for vacuum */
116 bool VacuumCostActive = false;
118 int GinFuzzySearchLimit = 0;