]> granicus.if.org Git - postgresql/blob - src/backend/utils/init/globals.c
1b0ecdc33aefc54ca1cb294db4172d82f63315d0
[postgresql] / src / backend / utils / init / globals.c
1 /*-------------------------------------------------------------------------
2  *
3  * globals.c
4  *        global variable declarations
5  *
6  * Portions Copyright (c) 1996-2000, PostgreSQL, Inc
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.43 2000/05/05 03:09:43 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 <fcntl.h>
20 #include <sys/file.h>
21 #include <sys/types.h>
22 #include <math.h>
23 #include <unistd.h>
24
25 #include "postgres.h"
26
27 #include "catalog/catname.h"
28 #include "catalog/indexing.h"
29 #include "libpq/pqcomm.h"
30 #include "miscadmin.h"
31 #include "storage/backendid.h"
32 #include "storage/lmgr.h"
33
34 ProtocolVersion FrontendProtocol = PG_PROTOCOL_LATEST;
35
36 bool            Noversion = false;
37 bool            Quiet = false;
38 bool            QueryCancel = false;
39
40 int                     MyProcPid;
41 struct Port *MyProcPort;
42 long            MyCancelKey;
43
44 char       *DataDir = NULL;
45
46  /*
47   * The PGDATA directory user says to use, or defaults to via environment
48   * variable.  NULL if no option given and no environment variable set
49   */
50
51 Relation        reldesc;                        /* current relation descriptor */
52
53 char            OutputFileName[MAXPGPATH] = "";
54
55 BackendId       MyBackendId;
56 BackendTag      MyBackendTag;
57
58 char       *UserName = NULL;
59 char       *DatabaseName = NULL;
60 char       *DatabasePath = NULL;
61
62 bool            MyDatabaseIdIsInitialized = false;
63 Oid                     MyDatabaseId = InvalidOid;
64 bool            TransactionInitWasProcessed = false;
65
66 bool            IsUnderPostmaster = false;
67
68 int                     DebugLvl = 0;
69
70 int                     DateStyle = USE_ISO_DATES;
71 bool            EuroDates = false;
72 bool            HasCTZSet = false;
73 bool            CDayLight = false;
74 int                     CTimeZone = 0;
75 char            CTZName[MAXTZLEN + 1] = "";
76
77 char            DateFormat[20] = "%d-%m-%Y";            /* mjl: sizes! or better
78                                                                                                  * malloc? XXX */
79 char            FloatFormat[20] = "%f";
80
81 bool            allowSystemTableMods = false;
82 int                     SortMem = 512;
83
84 char       *IndexedCatalogNames[] = {
85         AttributeRelationName,
86         ProcedureRelationName,
87         TypeRelationName,
88         RelationRelationName,
89         0
90 };
91
92
93 /*
94  * ps status buffer
95  */
96 #ifndef linux
97 char            Ps_status_buffer[1024];
98
99 #endif
100
101 /* ----------------
102  * we just do a linear search now so there's no requirement that the list
103  * be ordered.  The list is so small it shouldn't make much difference.
104  * make sure the list is null-terminated
105  *                              - jolly 8/19/95
106  *
107  * OLD COMMENT
108  *              WARNING  WARNING  WARNING  WARNING      WARNING  WARNING
109  *
110  *              keep SharedSystemRelationNames[] in SORTED order!  A binary search
111  *              is done on it in catalog.c!
112  *
113  *              XXX this is a serious hack which should be fixed -cim 1/26/90
114  * ----------------
115  */
116 char       *SharedSystemRelationNames[] = {
117         DatabaseRelationName,
118         GroupRelationName,
119         GroupNameIndex,
120         GroupSysidIndex,
121         LogRelationName,
122         ShadowRelationName,
123         VariableRelationName,
124         0
125 };