1 /*-------------------------------------------------------------------------
4 * global variable declarations
6 * Portions Copyright (c) 1996-2007, 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.101 2007/04/16 18:29:54 alvherre 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 struct Port *MyProcPort;
40 * DataDir is the absolute path to the top level of the PGDATA directory tree.
41 * Except during early startup, this is also the server's working directory;
42 * most code therefore can simply use relative paths and not reference DataDir
47 char OutputFileName[MAXPGPATH]; /* debugging output file */
49 char my_exec_path[MAXPGPATH]; /* full path to my executable */
50 char pkglib_path[MAXPGPATH]; /* full path to lib directory */
53 char postgres_exec_path[MAXPGPATH]; /* full path to backend */
55 /* note: currently this is not valid in backend processes */
58 BackendId MyBackendId = InvalidBackendId;
60 Oid MyDatabaseId = InvalidOid;
62 Oid MyDatabaseTableSpace = InvalidOid;
65 * DatabasePath is the path (relative to DataDir) of my database's
66 * primary directory, ie, its directory in the default tablespace.
68 char *DatabasePath = NULL;
70 pid_t PostmasterPid = 0;
73 * IsPostmasterEnvironment is true in a postmaster process and any postmaster
74 * child process; it is false in a standalone process (bootstrap or
75 * standalone backend). IsUnderPostmaster is true in postmaster child
76 * processes. Note that "child process" includes all children, not only
77 * regular backends. These should be set correctly as early as possible
78 * in the execution of a process, so that error handling will do the right
79 * things if an error should occur during process initialization.
81 * These are initialized for the bootstrap/standalone case.
83 bool IsPostmasterEnvironment = false;
84 bool IsUnderPostmaster = false;
86 bool ExitOnAnyError = false;
88 int DateStyle = USE_ISO_DATES;
89 int DateOrder = DATEORDER_MDY;
90 bool HasCTZSet = false;
93 bool enableFsync = true;
94 bool allowSystemTableMods = false;
96 int maintenance_work_mem = 16384;
99 * Primary determinants of sizes of shared-memory structures. MaxBackends is
100 * MaxConnections + autovacuum_max_workers (it is computed by the GUC assign
104 int MaxBackends = 100;
105 int MaxConnections = 90;
107 int VacuumCostPageHit = 1; /* GUC parameters for vacuum */
108 int VacuumCostPageMiss = 10;
109 int VacuumCostPageDirty = 20;
110 int VacuumCostLimit = 200;
111 int VacuumCostDelay = 0;
113 int VacuumCostBalance = 0; /* working state for vacuum */
114 bool VacuumCostActive = false;
116 int GinFuzzySearchLimit = 0;