]> granicus.if.org Git - postgresql/blob - src/backend/utils/init/globals.c
From: Thomas Lockhart <Thomas.G.Lockhart@jpl.nasa.gov>
[postgresql] / src / backend / utils / init / globals.c
1 /*-------------------------------------------------------------------------
2  *
3  * globals.c--
4  *    global variable declarations
5  *
6  * Copyright (c) 1994, Regents of the University of California
7  *
8  *
9  * IDENTIFICATION
10  *    $Header: /cvsroot/pgsql/src/backend/utils/init/globals.c,v 1.9 1997/03/28 07:18:06 scrappy Exp $
11  *
12  * NOTES
13  *    Globals used all over the place should be declared here and not
14  *    in other modules.  
15  *
16  *-------------------------------------------------------------------------
17  */
18 #include <fcntl.h>
19 #include <stdio.h>
20 #include <string.h>
21 #include <sys/file.h>
22 #include <sys/types.h>
23 #include <math.h>
24 #include <unistd.h>
25
26 #include "postgres.h"
27 #include "miscadmin.h"          /* where the declarations go */
28
29 #include <storage/backendid.h>
30 #include "access/heapam.h"
31 #include "utils/tqual.h"
32 #include "storage/sinval.h"
33 #include "storage/sinvaladt.h"
34 #include "storage/lmgr.h"
35 #include "utils/elog.h"
36
37 #include "catalog/catname.h"
38
39 int             Portfd = -1;
40 int             Noversion = 0;
41 int             Quiet = 1;
42
43 int             MasterPid;
44 char            *DataDir;
45   /* The PGDATA directory user says to use, or defaults to via environment
46      variable.  NULL if no option given and no environment variable set 
47   */
48 Relation        reldesc;                /* current relation descriptor */
49     
50 char            OutputFileName[MAXPGPATH] = "";
51
52 BackendId       MyBackendId;
53 BackendTag      MyBackendTag;
54
55 char            *UserName = NULL;
56 char            *DatabaseName = NULL;
57 char            *DatabasePath = NULL;
58
59 bool            MyDatabaseIdIsInitialized = false;
60 Oid             MyDatabaseId = InvalidOid;
61 bool            TransactionInitWasProcessed = false;
62
63 bool            IsUnderPostmaster = false;
64 bool            IsPostmaster = false;
65
66 short           DebugLvl = 0;
67
68 int             DateStyle = USE_POSTGRES_DATES;
69 bool            EuroDates = false;
70 bool            HasCTZSet = false;
71 bool            CDayLight = false;
72 int             CTimeZone = 0;
73 char            CTZName[MAXTZLEN+1] = "";
74
75 char DateFormat[20]     = "%d-%m-%Y";   /* mjl: sizes! or better malloc? XXX */
76 char FloatFormat[20] = "%f";
77
78 char *IndexedCatalogNames[] = {
79     AttributeRelationName,
80     ProcedureRelationName,
81     TypeRelationName,
82     RelationRelationName,
83     0
84 };
85
86
87 /* ----------------
88  * we just do a linear search now so there's no requirement that the list
89  * be ordered.  The list is so small it shouldn't make much difference.
90  * make sure the list is null-terminated
91  *              - jolly 8/19/95
92  *                                  
93  * OLD COMMENT
94  *      WARNING  WARNING  WARNING  WARNING  WARNING  WARNING
95  *
96  *      keep SharedSystemRelationNames[] in SORTED order!  A binary search
97  *      is done on it in catalog.c!
98  *
99  *      XXX this is a serious hack which should be fixed -cim 1/26/90
100  * ----------------
101  */
102 char *SharedSystemRelationNames[] = {
103     DatabaseRelationName, 
104     DefaultsRelationName,
105     DemonRelationName,
106     GroupRelationName,
107     HostsRelationName,
108     LogRelationName,
109     MagicRelationName,
110     ServerRelationName,
111     TimeRelationName,
112     UserRelationName,
113     VariableRelationName,
114     0
115 };