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