]> granicus.if.org Git - postgresql/blob - src/include/pg_config_manual.h
8.4 pgindent run, with new combined Linux/FreeBSD/MinGW typedef list
[postgresql] / src / include / pg_config_manual.h
1 /*------------------------------------------------------------------------
2  * PostgreSQL manual configuration settings
3  *
4  * This file contains various configuration symbols and limits.  In
5  * all cases, changing them is only useful in very rare situations or
6  * for developers.      If you edit any of these, be sure to do a *full*
7  * rebuild (and an initdb if noted).
8  *
9  * $PostgreSQL: pgsql/src/include/pg_config_manual.h,v 1.39 2009/06/11 14:49:08 momjian Exp $
10  *------------------------------------------------------------------------
11  */
12
13 /*
14  * Maximum length for identifiers (e.g. table names, column names,
15  * function names).  Names actually are limited to one less byte than this,
16  * because the length must include a trailing zero byte.
17  *
18  * Changing this requires an initdb.
19  */
20 #define NAMEDATALEN 64
21
22 /*
23  * Maximum number of arguments to a function.
24  *
25  * The minimum value is 8 (index cost estimation uses 8-argument functions).
26  * The maximum possible value is around 600 (limited by index tuple size in
27  * pg_proc's index; BLCKSZ larger than 8K would allow more).  Values larger
28  * than needed will waste memory and processing time, but do not directly
29  * cost disk space.
30  *
31  * Changing this does not require an initdb, but it does require a full
32  * backend recompile (including any user-defined C functions).
33  */
34 #define FUNC_MAX_ARGS           100
35
36 /*
37  * Maximum number of columns in an index.  There is little point in making
38  * this anything but a multiple of 32, because the main cost is associated
39  * with index tuple header size (see access/itup.h).
40  *
41  * Changing this requires an initdb.
42  */
43 #define INDEX_MAX_KEYS          32
44
45 /*
46  * Set the upper and lower bounds of sequence values.
47  */
48 #ifndef INT64_IS_BUSTED
49 #define SEQ_MAXVALUE    INT64CONST(0x7FFFFFFFFFFFFFFF)
50 #else                                                   /* INT64_IS_BUSTED */
51 #define SEQ_MAXVALUE    ((int64) 0x7FFFFFFF)
52 #endif   /* INT64_IS_BUSTED */
53
54 #define SEQ_MINVALUE    (-SEQ_MAXVALUE)
55
56 /*
57  * Number of spare LWLocks to allocate for user-defined add-on code.
58  */
59 #define NUM_USER_DEFINED_LWLOCKS        4
60
61 /*
62  * Define this if you want to allow the lo_import and lo_export SQL
63  * functions to be executed by ordinary users.  By default these
64  * functions are only available to the Postgres superuser.      CAUTION:
65  * These functions are SECURITY HOLES since they can read and write
66  * any file that the PostgreSQL server has permission to access.  If
67  * you turn this on, don't say we didn't warn you.
68  */
69 /* #define ALLOW_DANGEROUS_LO_FUNCTIONS */
70
71 /*
72  * MAXPGPATH: standard size of a pathname buffer in PostgreSQL (hence,
73  * maximum usable pathname length is one less).
74  *
75  * We'd use a standard system header symbol for this, if there weren't
76  * so many to choose from: MAXPATHLEN, MAX_PATH, PATH_MAX are all
77  * defined by different "standards", and often have different values
78  * on the same platform!  So we just punt and use a reasonably
79  * generous setting here.
80  */
81 #define MAXPGPATH               1024
82
83 /*
84  * PG_SOMAXCONN: maximum accept-queue length limit passed to
85  * listen(2).  You'd think we should use SOMAXCONN from
86  * <sys/socket.h>, but on many systems that symbol is much smaller
87  * than the kernel's actual limit.  In any case, this symbol need be
88  * twiddled only if you have a kernel that refuses large limit values,
89  * rather than silently reducing the value to what it can handle
90  * (which is what most if not all Unixen do).
91  */
92 #define PG_SOMAXCONN    10000
93
94 /*
95  * You can try changing this if you have a machine with bytes of
96  * another size, but no guarantee...
97  */
98 #define BITS_PER_BYTE           8
99
100 /*
101  * Preferred alignment for disk I/O buffers.  On some CPUs, copies between
102  * user space and kernel space are significantly faster if the user buffer
103  * is aligned on a larger-than-MAXALIGN boundary.  Ideally this should be
104  * a platform-dependent value, but for now we just hard-wire it.
105  */
106 #define ALIGNOF_BUFFER  32
107
108 /*
109  * Disable UNIX sockets for certain operating systems.
110  */
111 #if defined(WIN32)
112 #undef HAVE_UNIX_SOCKETS
113 #endif
114
115 /*
116  * Define this if your operating system supports link()
117  */
118 #if !defined(WIN32) && !defined(__CYGWIN__)
119 #define HAVE_WORKING_LINK 1
120 #endif
121
122 /*
123  * USE_POSIX_FADVISE controls whether Postgres will attempt to use the
124  * posix_fadvise() kernel call.  Usually the automatic configure tests are
125  * sufficient, but some older Linux distributions had broken versions of
126  * posix_fadvise().  If necessary you can remove the #define here.
127  */
128 #if HAVE_DECL_POSIX_FADVISE && defined(HAVE_POSIX_FADVISE)
129 #define USE_POSIX_FADVISE
130 #endif
131
132 /*
133  * USE_PREFETCH code should be compiled only if we have a way to implement
134  * prefetching.  (This is decoupled from USE_POSIX_FADVISE because there
135  * might in future be support for alternative low-level prefetch APIs.)
136  */
137 #ifdef USE_POSIX_FADVISE
138 #define USE_PREFETCH
139 #endif
140
141 /*
142  * This is the default directory in which AF_UNIX socket files are
143  * placed.      Caution: changing this risks breaking your existing client
144  * applications, which are likely to continue to look in the old
145  * directory.  But if you just hate the idea of sockets in /tmp,
146  * here's where to twiddle it.  You can also override this at runtime
147  * with the postmaster's -k switch.
148  */
149 #define DEFAULT_PGSOCKET_DIR  "/tmp"
150
151 /*
152  * The random() function is expected to yield values between 0 and
153  * MAX_RANDOM_VALUE.  Currently, all known implementations yield
154  * 0..2^31-1, so we just hardwire this constant.  We could do a
155  * configure test if it proves to be necessary.  CAUTION: Think not to
156  * replace this with RAND_MAX.  RAND_MAX defines the maximum value of
157  * the older rand() function, which is often different from --- and
158  * considerably inferior to --- random().
159  */
160 #define MAX_RANDOM_VALUE  (0x7FFFFFFF)
161
162
163 /*
164  *------------------------------------------------------------------------
165  * The following symbols are for enabling debugging code, not for
166  * controlling user-visible features or resource limits.
167  *------------------------------------------------------------------------
168  */
169
170 /*
171  * Define this to cause pfree()'d memory to be cleared immediately, to
172  * facilitate catching bugs that refer to already-freed values.
173  * Right now, this gets defined automatically if --enable-cassert.
174  */
175 #ifdef USE_ASSERT_CHECKING
176 #define CLOBBER_FREED_MEMORY
177 #endif
178
179 /*
180  * Define this to check memory allocation errors (scribbling on more
181  * bytes than were allocated).  Right now, this gets defined
182  * automatically if --enable-cassert.
183  */
184 #ifdef USE_ASSERT_CHECKING
185 #define MEMORY_CONTEXT_CHECKING
186 #endif
187
188 /*
189  * Define this to cause palloc()'d memory to be filled with random data, to
190  * facilitate catching code that depends on the contents of uninitialized
191  * memory.      Caution: this is horrendously expensive.
192  */
193 /* #define RANDOMIZE_ALLOCATED_MEMORY */
194
195 /*
196  * Define this to force all parse and plan trees to be passed through
197  * copyObject(), to facilitate catching errors and omissions in
198  * copyObject().
199  */
200 /* #define COPY_PARSE_PLAN_TREES */
201
202 /*
203  * Enable debugging print statements for lock-related operations.
204  */
205 /* #define LOCK_DEBUG */
206
207 /*
208  * Enable debugging print statements for WAL-related operations; see
209  * also the wal_debug GUC var.
210  */
211 /* #define WAL_DEBUG */
212
213 /*
214  * Enable tracing of resource consumption during sort operations;
215  * see also the trace_sort GUC var.  For 8.1 this is enabled by default.
216  */
217 #define TRACE_SORT 1
218
219 /*
220  * Enable tracing of syncscan operations (see also the trace_syncscan GUC var).
221  */
222 /* #define TRACE_SYNCSCAN */
223
224 /*
225  * Other debug #defines (documentation, anyone?)
226  */
227 /* #define HEAPDEBUGALL */
228 /* #define ACLDEBUG */
229 /* #define RTDEBUG */