1 /*-------------------------------------------------------------------------
4 * global variable declarations
6 * Portions Copyright (c) 1996-2003, 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.92 2004/08/06 04:15:09 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 struct Port *MyProcPort;
42 * The PGDATA directory user says to use, or defaults to via environment
43 * variable. NULL if no option given and no environment variable set
46 char OutputFileName[MAXPGPATH]; /* debugging output file */
48 char my_exec_path[MAXPGPATH]; /* full path to my executable */
49 char pkglib_path[MAXPGPATH]; /* full path to lib directory */
52 char postgres_exec_path[MAXPGPATH]; /* full path to backend */
53 /* note: currently this is not valid in backend processes */
56 BackendId MyBackendId = InvalidBackendId;
58 char *DatabasePath = NULL;
59 Oid MyDatabaseId = InvalidOid;
61 Oid MyDatabaseTableSpace = InvalidOid;
63 pid_t PostmasterPid = 0;
66 * IsPostmasterEnvironment is true in a postmaster process and any postmaster
67 * child process; it is false in a standalone process (bootstrap or
68 * standalone backend). IsUnderPostmaster is true in postmaster child
69 * processes. Note that "child process" includes all children, not only
70 * regular backends. These should be set correctly as early as possible
71 * in the execution of a process, so that error handling will do the right
72 * things if an error should occur during process initialization.
74 * These are initialized for the bootstrap/standalone case.
76 bool IsPostmasterEnvironment = false;
77 bool IsUnderPostmaster = false;
79 bool ExitOnAnyError = false;
81 int DateStyle = USE_ISO_DATES;
82 int DateOrder = DATEORDER_MDY;
83 bool HasCTZSet = false;
86 bool enableFsync = true;
87 bool allowSystemTableMods = false;
89 int maintenance_work_mem = 16384;
91 /* Primary determinants of sizes of shared-memory structures: */
93 int MaxBackends = 100;
95 int VacuumCostPageHit = 1; /* GUC parameters for vacuum */
96 int VacuumCostPageMiss = 10;
97 int VacuumCostPageDirty = 20;
98 int VacuumCostLimit = 200;
99 int VacuumCostDelay = 0;
101 int VacuumCostBalance = 0; /* working state for vacuum */
102 bool VacuumCostActive = false;