globals.c 2.68 KB
Newer Older
1 2
/*-------------------------------------------------------------------------
 *
3
 * globals.c
4
 *	  global variable declarations
5
 *
6
 * Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
Bruce Momjian's avatar
Add:  
Bruce Momjian committed
7
 * Portions Copyright (c) 1994, Regents of the University of California
8 9 10
 *
 *
 * IDENTIFICATION
11
 *	  $Header: /cvsroot/pgsql/src/backend/utils/init/globals.c,v 1.58 2001/06/12 05:55:50 tgl Exp $
12 13
 *
 * NOTES
14 15
 *	  Globals used all over the place should be declared here and not
 *	  in other modules.
16 17 18
 *
 *-------------------------------------------------------------------------
 */
Tom Lane's avatar
Tom Lane committed
19 20
#include "postgres.h"

21 22 23 24
#include <fcntl.h>
#include <sys/file.h>
#include <sys/types.h>
#include <math.h>
25
#include <unistd.h>
26

Bruce Momjian's avatar
Bruce Momjian committed
27
#include "catalog/catname.h"
28
#include "catalog/indexing.h"
Bruce Momjian's avatar
Bruce Momjian committed
29 30
#include "libpq/pqcomm.h"
#include "miscadmin.h"
31
#include "storage/backendid.h"
32

33

34
ProtocolVersion FrontendProtocol = PG_PROTOCOL_LATEST;
35 36

bool		Noversion = false;
37 38 39 40 41

volatile bool InterruptPending = false;
volatile bool QueryCancelPending = false;
volatile bool ProcDiePending = false;
volatile bool ImmediateInterruptOK = false;
42
volatile uint32 InterruptHoldoffCount = 0;
43
volatile uint32 CritSectionCount = 0;
44

Bruce Momjian's avatar
Bruce Momjian committed
45
int			MyProcPid;
46
struct Port *MyProcPort;
47 48
long		MyCancelKey;

49
char	   *DataDir = NULL;
Bruce Momjian's avatar
Bruce Momjian committed
50

51 52 53
 /*
  * The PGDATA directory user says to use, or defaults to via environment
  * variable.  NULL if no option given and no environment variable set
54
  */
55

56
Relation	reldesc;			/* current relation descriptor */
57

58
char		OutputFileName[MAXPGPATH] = "";
59

60
BackendId	MyBackendId;
61

62 63
char	   *DatabaseName = NULL;
char	   *DatabasePath = NULL;
64

65
Oid			MyDatabaseId = InvalidOid;
66

67
bool		IsUnderPostmaster = false;
68

69
int			DebugLvl = 0;
70

71
int			DateStyle = USE_ISO_DATES;
72 73 74 75 76
bool		EuroDates = false;
bool		HasCTZSet = false;
bool		CDayLight = false;
int			CTimeZone = 0;
char		CTZName[MAXTZLEN + 1] = "";
77

78
char		DateFormat[20] = "%d-%m-%Y";		/* mjl: sizes! or better
79
												 * malloc? XXX */
80
char		FloatFormat[20] = "%f";
81

82
bool		enableFsync = true;
83
bool		allowSystemTableMods = false;
84
int			SortMem = 512;
85 86
int			NBuffers = DEF_NBUFFERS;

87

88
/* ----------------
89 90 91 92
 * List of relations that are shared across all databases in an installation.
 *
 * This used to be binary-searched, requiring that it be kept in sorted order.
 * We just do a linear search now so there's no requirement that the list
93
 * be ordered.	The list is so small it shouldn't make much difference.
94
 * make sure the list is null-terminated
95
 *				- jolly 8/19/95
96 97
 * ----------------
 */
98
char	   *SharedSystemRelationNames[] = {
99
	DatabaseRelationName,
100 101
	DatabaseNameIndex,
	DatabaseOidIndex,
102
	GroupRelationName,
103 104
	GroupNameIndex,
	GroupSysidIndex,
105
	LogRelationName,
106
	ShadowRelationName,
107 108 109
	ShadowNameIndex,
	ShadowSysidIndex,
	NULL
110
};