]> granicus.if.org Git - postgresql/blob - src/backend/utils/init/globals.c
Massimo's SET FSYNC and SHOW PG_OPTIONS changes, without SET QUERY_LIMIT.
[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.37 1999/09/27 20:27:09 momjian 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 <sys/file.h>
20 #include <sys/types.h>
21 #include <math.h>
22 #include <unistd.h>
23
24 #include "postgres.h"
25
26 #include "catalog/catname.h"
27 #include "libpq/pqcomm.h"
28 #include "miscadmin.h"
29 #include "storage/backendid.h"
30 #include "storage/lmgr.h"
31
32 ProtocolVersion FrontendProtocol = PG_PROTOCOL_LATEST;
33
34 bool            Noversion = false;
35 bool            Quiet = false;
36 bool            QueryCancel = false;
37
38 int                     MyProcPid;
39 struct Port *MyProcPort;
40 long            MyCancelKey;
41
42 char       *DataDir = NULL;
43
44  /*
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
49 Relation        reldesc;                        /* current relation descriptor */
50
51 char            OutputFileName[MAXPGPATH] = "";
52
53 BackendId       MyBackendId;
54 BackendTag      MyBackendTag;
55
56 char       *UserName = NULL;
57 char       *DatabaseName = NULL;
58 char       *DatabasePath = NULL;
59
60 bool            MyDatabaseIdIsInitialized = false;
61 Oid                     MyDatabaseId = InvalidOid;
62 bool            TransactionInitWasProcessed = false;
63
64 bool            IsUnderPostmaster = 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
76                                                                                                  * malloc? XXX */
77 char            FloatFormat[20] = "%f";
78
79 bool            allowSystemTableMods = false;
80 int                     SortMem = 512;
81
82 char       *IndexedCatalogNames[] = {
83         AttributeRelationName,
84         ProcedureRelationName,
85         TypeRelationName,
86         RelationRelationName,
87         0
88 };
89
90
91 /* ----------------
92  * 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  * OLD COMMENT
98  *              WARNING  WARNING  WARNING  WARNING      WARNING  WARNING
99  *
100  *              keep SharedSystemRelationNames[] in SORTED order!  A binary search
101  *              is done on it in catalog.c!
102  *
103  *              XXX this is a serious hack which should be fixed -cim 1/26/90
104  * ----------------
105  */
106 char       *SharedSystemRelationNames[] = {
107         DatabaseRelationName,
108         GroupRelationName,
109         LogRelationName,
110         ShadowRelationName,
111         VariableRelationName,
112         0
113 };