]> granicus.if.org Git - postgresql/blob - src/backend/utils/init/globals.c
Centralize implementation of delay code by creating a pg_usleep()
[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.84 2004/02/10 03:42:45 tgl 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];
47
48 char            pg_pathname[MAXPGPATH];         /* full path to postgres
49                                                                                  * executable */
50
51 BackendId       MyBackendId;
52
53 char       *DatabasePath = NULL;
54 Oid                     MyDatabaseId = InvalidOid;
55
56 pid_t           PostmasterPid = 0;
57
58 /*
59  * IsPostmasterEnvironment is true in a postmaster process and any postmaster
60  * child process; it is false in a standalone process (bootstrap or
61  * standalone backend).  IsUnderPostmaster is true in postmaster child
62  * processes.  Note that "child process" includes all children, not only
63  * regular backends.  These should be set correctly as early as possible
64  * in the execution of a process, so that error handling will do the right
65  * things if an error should occur during process initialization.
66  *
67  * These are initialized for the bootstrap/standalone case.
68  */
69 bool            IsPostmasterEnvironment = false;
70 bool            IsUnderPostmaster = false;
71
72 bool            ExitOnAnyError = false;
73
74 int                     DateStyle = USE_ISO_DATES;
75 int                     DateOrder = DATEORDER_MDY;
76 bool            HasCTZSet = false;
77 int                     CTimeZone = 0;
78
79 bool            enableFsync = true;
80 bool            allowSystemTableMods = false;
81 int                     work_mem = 1024;
82 int                     maintenance_work_mem = 16384;
83 int                     NBuffers = 1000;
84
85 int                     VacuumCostPageHit = 1;                  /* GUC parameters for vacuum */
86 int                     VacuumCostPageMiss = 10;
87 int                     VacuumCostPageDirty = 20;
88 int                     VacuumCostLimit = 200;
89 int                     VacuumCostNaptime = 0;
90
91 int                     VacuumCostBalance = 0;                  /* working state for vacuum */
92 bool            VacuumCostActive = false;