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