PostgreSQL Source Code
git master
pg_config_manual.h
Go to the documentation of this file.
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
* Portions Copyright (c) 1996-2021, PostgreSQL Global Development Group
10
* Portions Copyright (c) 1994, Regents of the University of California
11
*
12
* src/include/pg_config_manual.h
13
*------------------------------------------------------------------------
14
*/
15
16
/*
17
* This is the default value for wal_segment_size to be used when initdb is run
18
* without the --wal-segsize option. It must be a valid segment size.
19
*/
20
#define DEFAULT_XLOG_SEG_SIZE (16*1024*1024)
21
22
/*
23
* Maximum length for identifiers (e.g. table names, column names,
24
* function names). Names actually are limited to one less byte than this,
25
* because the length must include a trailing zero byte.
26
*
27
* Changing this requires an initdb.
28
*/
29
#define NAMEDATALEN 64
30
31
/*
32
* Maximum number of arguments to a function.
33
*
34
* The minimum value is 8 (GIN indexes use 8-argument support functions).
35
* The maximum possible value is around 600 (limited by index tuple size in
36
* pg_proc's index; BLCKSZ larger than 8K would allow more). Values larger
37
* than needed will waste memory and processing time, but do not directly
38
* cost disk space.
39
*
40
* Changing this does not require an initdb, but it does require a full
41
* backend recompile (including any user-defined C functions).
42
*/
43
#define FUNC_MAX_ARGS 100
44
45
/*
46
* Maximum number of columns in an index. There is little point in making
47
* this anything but a multiple of 32, because the main cost is associated
48
* with index tuple header size (see access/itup.h).
49
*
50
* Changing this requires an initdb.
51
*/
52
#define INDEX_MAX_KEYS 32
53
54
/*
55
* Maximum number of columns in a partition key
56
*/
57
#define PARTITION_MAX_KEYS 32
58
59
/*
60
* Decide whether built-in 8-byte types, including float8, int8, and
61
* timestamp, are passed by value. This is on by default if sizeof(Datum) >=
62
* 8 (that is, on 64-bit platforms). If sizeof(Datum) < 8 (32-bit platforms),
63
* this must be off. We keep this here as an option so that it is easy to
64
* test the pass-by-reference code paths on 64-bit platforms.
65
*
66
* Changing this requires an initdb.
67
*/
68
#if SIZEOF_VOID_P >= 8
69
#define USE_FLOAT8_BYVAL 1
70
#endif
71
72
/*
73
* When we don't have native spinlocks, we use semaphores to simulate them.
74
* Decreasing this value reduces consumption of OS resources; increasing it
75
* may improve performance, but supplying a real spinlock implementation is
76
* probably far better.
77
*/
78
#define NUM_SPINLOCK_SEMAPHORES 128
79
80
/*
81
* When we have neither spinlocks nor atomic operations support we're
82
* implementing atomic operations on top of spinlock on top of semaphores. To
83
* be safe against atomic operations while holding a spinlock separate
84
* semaphores have to be used.
85
*/
86
#define NUM_ATOMICS_SEMAPHORES 64
87
88
/*
89
* MAXPGPATH: standard size of a pathname buffer in PostgreSQL (hence,
90
* maximum usable pathname length is one less).
91
*
92
* We'd use a standard system header symbol for this, if there weren't
93
* so many to choose from: MAXPATHLEN, MAX_PATH, PATH_MAX are all
94
* defined by different "standards", and often have different values
95
* on the same platform! So we just punt and use a reasonably
96
* generous setting here.
97
*/
98
#define MAXPGPATH 1024
99
100
/*
101
* PG_SOMAXCONN: maximum accept-queue length limit passed to
102
* listen(2). You'd think we should use SOMAXCONN from
103
* <sys/socket.h>, but on many systems that symbol is much smaller
104
* than the kernel's actual limit. In any case, this symbol need be
105
* twiddled only if you have a kernel that refuses large limit values,
106
* rather than silently reducing the value to what it can handle
107
* (which is what most if not all Unixen do).
108
*/
109
#define PG_SOMAXCONN 10000
110
111
/*
112
* You can try changing this if you have a machine with bytes of
113
* another size, but no guarantee...
114
*/
115
#define BITS_PER_BYTE 8
116
117
/*
118
* Preferred alignment for disk I/O buffers. On some CPUs, copies between
119
* user space and kernel space are significantly faster if the user buffer
120
* is aligned on a larger-than-MAXALIGN boundary. Ideally this should be
121
* a platform-dependent value, but for now we just hard-wire it.
122
*/
123
#define ALIGNOF_BUFFER 32
124
125
/*
126
* If EXEC_BACKEND is defined, the postmaster uses an alternative method for
127
* starting subprocesses: Instead of simply using fork(), as is standard on
128
* Unix platforms, it uses fork()+exec() or something equivalent on Windows,
129
* as well as lots of extra code to bring the required global state to those
130
* new processes. This must be enabled on Windows (because there is no
131
* fork()). On other platforms, it's only useful for verifying those
132
* otherwise Windows-specific code paths.
133
*/
134
#if defined(WIN32) && !defined(__CYGWIN__)
135
#define EXEC_BACKEND
136
#endif
137
138
/*
139
* USE_POSIX_FADVISE controls whether Postgres will attempt to use the
140
* posix_fadvise() kernel call. Usually the automatic configure tests are
141
* sufficient, but some older Linux distributions had broken versions of
142
* posix_fadvise(). If necessary you can remove the #define here.
143
*/
144
#if HAVE_DECL_POSIX_FADVISE && defined(HAVE_POSIX_FADVISE)
145
#define USE_POSIX_FADVISE
146
#endif
147
148
/*
149
* USE_PREFETCH code should be compiled only if we have a way to implement
150
* prefetching. (This is decoupled from USE_POSIX_FADVISE because there
151
* might in future be support for alternative low-level prefetch APIs.
152
* If you change this, you probably need to adjust the error message in
153
* check_effective_io_concurrency.)
154
*/
155
#ifdef USE_POSIX_FADVISE
156
#define USE_PREFETCH
157
#endif
158
159
/*
160
* Default and maximum values for backend_flush_after, bgwriter_flush_after
161
* and checkpoint_flush_after; measured in blocks. Currently, these are
162
* enabled by default if sync_file_range() exists, ie, only on Linux. Perhaps
163
* we could also enable by default if we have mmap and msync(MS_ASYNC)?
164
*/
165
#ifdef HAVE_SYNC_FILE_RANGE
166
#define DEFAULT_BACKEND_FLUSH_AFTER 0
/* never enabled by default */
167
#define DEFAULT_BGWRITER_FLUSH_AFTER 64
168
#define DEFAULT_CHECKPOINT_FLUSH_AFTER 32
169
#else
170
#define DEFAULT_BACKEND_FLUSH_AFTER 0
171
#define DEFAULT_BGWRITER_FLUSH_AFTER 0
172
#define DEFAULT_CHECKPOINT_FLUSH_AFTER 0
173
#endif
174
/* upper limit for all three variables */
175
#define WRITEBACK_MAX_PENDING_FLUSHES 256
176
177
/*
178
* USE_SSL code should be compiled only when compiling with an SSL
179
* implementation. (Currently, only OpenSSL is supported, but we might add
180
* more implementations in the future.)
181
*/
182
#ifdef USE_OPENSSL
183
#define USE_SSL
184
#endif
185
186
/*
187
* This is the default directory in which AF_UNIX socket files are
188
* placed. Caution: changing this risks breaking your existing client
189
* applications, which are likely to continue to look in the old
190
* directory. But if you just hate the idea of sockets in /tmp,
191
* here's where to twiddle it. You can also override this at runtime
192
* with the postmaster's -k switch.
193
*
194
* If set to an empty string, then AF_UNIX sockets are not used by default: A
195
* server will not create an AF_UNIX socket unless the run-time configuration
196
* is changed, a client will connect via TCP/IP by default and will only use
197
* an AF_UNIX socket if one is explicitly specified.
198
*
199
* This is done by default on Windows because there is no good standard
200
* location for AF_UNIX sockets and many installations on Windows don't
201
* support them yet.
202
*/
203
#ifndef WIN32
204
#define DEFAULT_PGSOCKET_DIR "/tmp"
205
#else
206
#define DEFAULT_PGSOCKET_DIR ""
207
#endif
208
209
/*
210
* This is the default event source for Windows event log.
211
*/
212
#define DEFAULT_EVENT_SOURCE "PostgreSQL"
213
214
/*
215
* The random() function is expected to yield values between 0 and
216
* MAX_RANDOM_VALUE. Currently, all known implementations yield
217
* 0..2^31-1, so we just hardwire this constant. We could do a
218
* configure test if it proves to be necessary. CAUTION: Think not to
219
* replace this with RAND_MAX. RAND_MAX defines the maximum value of
220
* the older rand() function, which is often different from --- and
221
* considerably inferior to --- random().
222
*/
223
#define MAX_RANDOM_VALUE PG_INT32_MAX
224
225
/*
226
* On PPC machines, decide whether to use the mutex hint bit in LWARX
227
* instructions. Setting the hint bit will slightly improve spinlock
228
* performance on POWER6 and later machines, but does nothing before that,
229
* and will result in illegal-instruction failures on some pre-POWER4
230
* machines. By default we use the hint bit when building for 64-bit PPC,
231
* which should be safe in nearly all cases. You might want to override
232
* this if you are building 32-bit code for a known-recent PPC machine.
233
*/
234
#ifdef HAVE_PPC_LWARX_MUTEX_HINT
/* must have assembler support in any case */
235
#if defined(__ppc64__) || defined(__powerpc64__)
236
#define USE_PPC_LWARX_MUTEX_HINT
237
#endif
238
#endif
239
240
/*
241
* On PPC machines, decide whether to use LWSYNC instructions in place of
242
* ISYNC and SYNC. This provides slightly better performance, but will
243
* result in illegal-instruction failures on some pre-POWER4 machines.
244
* By default we use LWSYNC when building for 64-bit PPC, which should be
245
* safe in nearly all cases.
246
*/
247
#if defined(__ppc64__) || defined(__powerpc64__)
248
#define USE_PPC_LWSYNC
249
#endif
250
251
/*
252
* Assumed cache line size. This doesn't affect correctness, but can be used
253
* for low-level optimizations. Currently, this is used to pad some data
254
* structures in xlog.c, to ensure that highly-contended fields are on
255
* different cache lines. Too small a value can hurt performance due to false
256
* sharing, while the only downside of too large a value is a few bytes of
257
* wasted memory. The default is 128, which should be large enough for all
258
* supported platforms.
259
*/
260
#define PG_CACHE_LINE_SIZE 128
261
262
/*
263
*------------------------------------------------------------------------
264
* The following symbols are for enabling debugging code, not for
265
* controlling user-visible features or resource limits.
266
*------------------------------------------------------------------------
267
*/
268
269
/*
270
* Include Valgrind "client requests", mostly in the memory allocator, so
271
* Valgrind understands PostgreSQL memory contexts. This permits detecting
272
* memory errors that Valgrind would not detect on a vanilla build. It also
273
* enables detection of buffer accesses that take place without holding a
274
* buffer pin (or without holding a buffer lock in the case of index access
275
* methods that superimpose their own custom client requests on top of the
276
* generic bufmgr.c requests). See also src/tools/valgrind.supp.
277
*
278
* "make installcheck" is significantly slower under Valgrind. The client
279
* requests fall in hot code paths, so USE_VALGRIND slows execution by a few
280
* percentage points even when not run under Valgrind.
281
*
282
* You should normally use MEMORY_CONTEXT_CHECKING with USE_VALGRIND;
283
* instrumentation of repalloc() is inferior without it.
284
*/
285
/* #define USE_VALGRIND */
286
287
/*
288
* Define this to cause pfree()'d memory to be cleared immediately, to
289
* facilitate catching bugs that refer to already-freed values.
290
* Right now, this gets defined automatically if --enable-cassert.
291
*/
292
#ifdef USE_ASSERT_CHECKING
293
#define CLOBBER_FREED_MEMORY
294
#endif
295
296
/*
297
* Define this to check memory allocation errors (scribbling on more
298
* bytes than were allocated). Right now, this gets defined
299
* automatically if --enable-cassert or USE_VALGRIND.
300
*/
301
#if defined(USE_ASSERT_CHECKING) || defined(USE_VALGRIND)
302
#define MEMORY_CONTEXT_CHECKING
303
#endif
304
305
/*
306
* Define this to cause palloc()'d memory to be filled with random data, to
307
* facilitate catching code that depends on the contents of uninitialized
308
* memory. Caution: this is horrendously expensive.
309
*/
310
/* #define RANDOMIZE_ALLOCATED_MEMORY */
311
312
/*
313
* For cache invalidation debugging, define CLOBBER_CACHE_ENABLED to enable
314
* use of the debug_invalidate_system_caches_always GUC to aggressively flush
315
* syscache/relcache entries whenever it's possible to deliver invalidations.
316
* See AcceptInvalidationMessages() in src/backend/utils/cache/inval.c for
317
* details.
318
*
319
* USE_ASSERT_CHECKING builds default to enabling this. It's possible to use
320
* CLOBBER_CACHE_ENABLED without a cassert build and the implied
321
* CLOBBER_FREED_MEMORY and MEMORY_CONTEXT_CHECKING options but it's unlikely
322
* to be as effective at identifying problems.
323
*/
324
/* #define CLOBBER_CACHE_ENABLED */
325
326
#if defined(USE_ASSERT_CHECKING) && !defined(CLOBBER_CACHE_ENABLED)
327
#define CLOBBER_CACHE_ENABLED
328
#endif
329
330
/*
331
* Backwards compatibility for the older compile-time-only cache clobber
332
* macros.
333
*/
334
#if !defined(CLOBBER_CACHE_ENABLED) && (defined(CLOBBER_CACHE_ALWAYS) || defined(CLOBBER_CACHE_RECURSIVELY))
335
#define CLOBBER_CACHE_ENABLED
336
#endif
337
338
/*
339
* Recover memory used for relcache entries when invalidated. See
340
* RelationBuildDescr() in src/backend/utils/cache/relcache.c.
341
*
342
* This is active automatically for clobber cache builds when clobbering is
343
* active, but can be overridden here by explicitly defining
344
* RECOVER_RELATION_BUILD_MEMORY. Define to 1 to always free relation cache
345
* memory even when clobber is off, or to 0 to never free relation cache
346
* memory even when clobbering is on.
347
*/
348
/* #define RECOVER_RELATION_BUILD_MEMORY 0 */
/* Force disable */
349
/* #define RECOVER_RELATION_BUILD_MEMORY 1 */
/* Force enable */
350
351
/*
352
* Define this to force all parse and plan trees to be passed through
353
* copyObject(), to facilitate catching errors and omissions in
354
* copyObject().
355
*/
356
/* #define COPY_PARSE_PLAN_TREES */
357
358
/*
359
* Define this to force all parse and plan trees to be passed through
360
* outfuncs.c/readfuncs.c, to facilitate catching errors and omissions in
361
* those modules.
362
*/
363
/* #define WRITE_READ_PARSE_PLAN_TREES */
364
365
/*
366
* Define this to force all raw parse trees for DML statements to be scanned
367
* by raw_expression_tree_walker(), to facilitate catching errors and
368
* omissions in that function.
369
*/
370
/* #define RAW_EXPRESSION_COVERAGE_TEST */
371
372
/*
373
* Enable debugging print statements for lock-related operations.
374
*/
375
/* #define LOCK_DEBUG */
376
377
/*
378
* Enable debugging print statements for WAL-related operations; see
379
* also the wal_debug GUC var.
380
*/
381
/* #define WAL_DEBUG */
382
383
/*
384
* Enable tracing of resource consumption during sort operations;
385
* see also the trace_sort GUC var. For 8.1 this is enabled by default.
386
*/
387
#define TRACE_SORT 1
388
389
/*
390
* Enable tracing of syncscan operations (see also the trace_syncscan GUC var).
391
*/
392
/* #define TRACE_SYNCSCAN */
src
include
pg_config_manual.h
Generated on Tue Jan 19 2021 12:13:25 for PostgreSQL Source Code by
1.8.13