]> granicus.if.org Git - postgresql/blob - src/backend/utils/init/globals.c
Rename vacuum_cost_naptime to vacuum_cost_delay, with agreement from Jan.
[postgresql] / src / backend / utils / init / globals.c
1 /*-------------------------------------------------------------------------
2  *
3  * globals.c
4  *        global variable declarations
5  *
6  * Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
7  * Portions Copyright (c) 1994, Regents of the University of California
8  *
9  *
10  * IDENTIFICATION
11  *        $PostgreSQL: pgsql/src/backend/utils/init/globals.c,v 1.92 2004/08/06 04:15:09 momjian Exp $
12  *
13  * NOTES
14  *        Globals used all over the place should be declared here and not
15  *        in other modules.
16  *
17  *-------------------------------------------------------------------------
18  */
19 #include "postgres.h"
20
21 #include "libpq/pqcomm.h"
22 #include "miscadmin.h"
23 #include "storage/backendid.h"
24
25
26 ProtocolVersion FrontendProtocol = PG_PROTOCOL_LATEST;
27
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;
34
35 int                     MyProcPid;
36 struct Port *MyProcPort;
37 long            MyCancelKey;
38
39 char       *DataDir = NULL;
40
41  /*
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
44   */
45
46 char            OutputFileName[MAXPGPATH];      /* debugging output file */
47
48 char            my_exec_path[MAXPGPATH];        /* full path to my executable */
49 char            pkglib_path[MAXPGPATH];         /* full path to lib directory */
50
51 #ifdef EXEC_BACKEND
52 char            postgres_exec_path[MAXPGPATH];  /* full path to backend */
53 /* note: currently this is not valid in backend processes */
54 #endif
55
56 BackendId       MyBackendId = InvalidBackendId;
57
58 char       *DatabasePath = NULL;
59 Oid                     MyDatabaseId = InvalidOid;
60
61 Oid                     MyDatabaseTableSpace = InvalidOid;
62
63 pid_t           PostmasterPid = 0;
64
65 /*
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.
73  *
74  * These are initialized for the bootstrap/standalone case.
75  */
76 bool            IsPostmasterEnvironment = false;
77 bool            IsUnderPostmaster = false;
78
79 bool            ExitOnAnyError = false;
80
81 int                     DateStyle = USE_ISO_DATES;
82 int                     DateOrder = DATEORDER_MDY;
83 bool            HasCTZSet = false;
84 int                     CTimeZone = 0;
85
86 bool            enableFsync = true;
87 bool            allowSystemTableMods = false;
88 int                     work_mem = 1024;
89 int                     maintenance_work_mem = 16384;
90
91 /* Primary determinants of sizes of shared-memory structures: */
92 int                     NBuffers = 1000;
93 int                     MaxBackends = 100;
94
95 int                     VacuumCostPageHit = 1;                  /* GUC parameters for vacuum */
96 int                     VacuumCostPageMiss = 10;
97 int                     VacuumCostPageDirty = 20;
98 int                     VacuumCostLimit = 200;
99 int                     VacuumCostDelay = 0;
100
101 int                     VacuumCostBalance = 0;                  /* working state for vacuum */
102 bool            VacuumCostActive = false;