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