~ubuntu-branches/ubuntu/oneiric/postgresql-9.1/oneiric-security

« back to all changes in this revision

Viewing changes to src/backend/utils/init/globals.c

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2011-05-11 10:41:53 UTC
  • Revision ID: james.westby@ubuntu.com-20110511104153-psbh2o58553fv1m0
Tags: upstream-9.1~beta1
ImportĀ upstreamĀ versionĀ 9.1~beta1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*-------------------------------------------------------------------------
 
2
 *
 
3
 * globals.c
 
4
 *        global variable declarations
 
5
 *
 
6
 * Portions Copyright (c) 1996-2011, PostgreSQL Global Development Group
 
7
 * Portions Copyright (c) 1994, Regents of the University of California
 
8
 *
 
9
 *
 
10
 * IDENTIFICATION
 
11
 *        src/backend/utils/init/globals.c
 
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 "catalog/objectaccess.h"
 
22
#include "libpq/pqcomm.h"
 
23
#include "miscadmin.h"
 
24
#include "storage/backendid.h"
 
25
 
 
26
 
 
27
ProtocolVersion FrontendProtocol;
 
28
 
 
29
volatile bool InterruptPending = false;
 
30
volatile bool QueryCancelPending = false;
 
31
volatile bool ProcDiePending = false;
 
32
volatile bool ImmediateInterruptOK = false;
 
33
volatile uint32 InterruptHoldoffCount = 0;
 
34
volatile uint32 CritSectionCount = 0;
 
35
 
 
36
int                     MyProcPid;
 
37
pg_time_t       MyStartTime;
 
38
struct Port *MyProcPort;
 
39
long            MyCancelKey;
 
40
int                     MyPMChildSlot;
 
41
 
 
42
/*
 
43
 * DataDir is the absolute path to the top level of the PGDATA directory tree.
 
44
 * Except during early startup, this is also the server's working directory;
 
45
 * most code therefore can simply use relative paths and not reference DataDir
 
46
 * explicitly.
 
47
 */
 
48
char       *DataDir = NULL;
 
49
 
 
50
char            OutputFileName[MAXPGPATH];      /* debugging output file */
 
51
 
 
52
char            my_exec_path[MAXPGPATH];        /* full path to my executable */
 
53
char            pkglib_path[MAXPGPATH];         /* full path to lib directory */
 
54
 
 
55
#ifdef EXEC_BACKEND
 
56
char            postgres_exec_path[MAXPGPATH];          /* full path to backend */
 
57
 
 
58
/* note: currently this is not valid in backend processes */
 
59
#endif
 
60
 
 
61
BackendId       MyBackendId = InvalidBackendId;
 
62
 
 
63
Oid                     MyDatabaseId = InvalidOid;
 
64
 
 
65
Oid                     MyDatabaseTableSpace = InvalidOid;
 
66
 
 
67
/*
 
68
 * DatabasePath is the path (relative to DataDir) of my database's
 
69
 * primary directory, ie, its directory in the default tablespace.
 
70
 */
 
71
char       *DatabasePath = NULL;
 
72
 
 
73
pid_t           PostmasterPid = 0;
 
74
 
 
75
/*
 
76
 * IsPostmasterEnvironment is true in a postmaster process and any postmaster
 
77
 * child process; it is false in a standalone process (bootstrap or
 
78
 * standalone backend).  IsUnderPostmaster is true in postmaster child
 
79
 * processes.  Note that "child process" includes all children, not only
 
80
 * regular backends.  These should be set correctly as early as possible
 
81
 * in the execution of a process, so that error handling will do the right
 
82
 * things if an error should occur during process initialization.
 
83
 *
 
84
 * These are initialized for the bootstrap/standalone case.
 
85
 */
 
86
bool            IsPostmasterEnvironment = false;
 
87
bool            IsUnderPostmaster = false;
 
88
bool            IsBinaryUpgrade = false;
 
89
 
 
90
bool            ExitOnAnyError = false;
 
91
 
 
92
int                     DateStyle = USE_ISO_DATES;
 
93
int                     DateOrder = DATEORDER_MDY;
 
94
int                     IntervalStyle = INTSTYLE_POSTGRES;
 
95
bool            HasCTZSet = false;
 
96
int                     CTimeZone = 0;
 
97
 
 
98
bool            enableFsync = true;
 
99
bool            allowSystemTableMods = false;
 
100
int                     work_mem = 1024;
 
101
int                     maintenance_work_mem = 16384;
 
102
 
 
103
/*
 
104
 * Primary determinants of sizes of shared-memory structures.  MaxBackends is
 
105
 * MaxConnections + autovacuum_max_workers + 1 (it is computed by the GUC
 
106
 * assign hooks for those variables):
 
107
 */
 
108
int                     NBuffers = 1000;
 
109
int                     MaxBackends = 100;
 
110
int                     MaxConnections = 90;
 
111
 
 
112
int                     VacuumCostPageHit = 1;          /* GUC parameters for vacuum */
 
113
int                     VacuumCostPageMiss = 10;
 
114
int                     VacuumCostPageDirty = 20;
 
115
int                     VacuumCostLimit = 200;
 
116
int                     VacuumCostDelay = 0;
 
117
 
 
118
int                     VacuumCostBalance = 0;          /* working state for vacuum */
 
119
bool            VacuumCostActive = false;
 
120
 
 
121
int                     GinFuzzySearchLimit = 0;
 
122
 
 
123
/*
 
124
 * Hook on object accesses.  This is intended as infrastructure for security
 
125
 * and logging plugins.
 
126
 */
 
127
object_access_hook_type object_access_hook = NULL;