Header And Logo

PostgreSQL
| The world's most advanced open source database.

pg_config_manual.h

Go to the documentation of this file.
00001 /*------------------------------------------------------------------------
00002  * PostgreSQL manual configuration settings
00003  *
00004  * This file contains various configuration symbols and limits.  In
00005  * all cases, changing them is only useful in very rare situations or
00006  * for developers.  If you edit any of these, be sure to do a *full*
00007  * rebuild (and an initdb if noted).
00008  *
00009  * Portions Copyright (c) 1996-2013, PostgreSQL Global Development Group
00010  * Portions Copyright (c) 1994, Regents of the University of California
00011  *
00012  * src/include/pg_config_manual.h
00013  *------------------------------------------------------------------------
00014  */
00015 
00016 /*
00017  * Maximum length for identifiers (e.g. table names, column names,
00018  * function names).  Names actually are limited to one less byte than this,
00019  * because the length must include a trailing zero byte.
00020  *
00021  * Changing this requires an initdb.
00022  */
00023 #define NAMEDATALEN 64
00024 
00025 /*
00026  * Maximum number of arguments to a function.
00027  *
00028  * The minimum value is 8 (GIN indexes use 8-argument support functions).
00029  * The maximum possible value is around 600 (limited by index tuple size in
00030  * pg_proc's index; BLCKSZ larger than 8K would allow more).  Values larger
00031  * than needed will waste memory and processing time, but do not directly
00032  * cost disk space.
00033  *
00034  * Changing this does not require an initdb, but it does require a full
00035  * backend recompile (including any user-defined C functions).
00036  */
00037 #define FUNC_MAX_ARGS       100
00038 
00039 /*
00040  * Maximum number of columns in an index.  There is little point in making
00041  * this anything but a multiple of 32, because the main cost is associated
00042  * with index tuple header size (see access/itup.h).
00043  *
00044  * Changing this requires an initdb.
00045  */
00046 #define INDEX_MAX_KEYS      32
00047 
00048 /*
00049  * Set the upper and lower bounds of sequence values.
00050  */
00051 #define SEQ_MAXVALUE    INT64CONST(0x7FFFFFFFFFFFFFFF)
00052 #define SEQ_MINVALUE    (-SEQ_MAXVALUE)
00053 
00054 /*
00055  * Number of spare LWLocks to allocate for user-defined add-on code.
00056  */
00057 #define NUM_USER_DEFINED_LWLOCKS    4
00058 
00059 /*
00060  * Define this if you want to allow the lo_import and lo_export SQL
00061  * functions to be executed by ordinary users.  By default these
00062  * functions are only available to the Postgres superuser.  CAUTION:
00063  * These functions are SECURITY HOLES since they can read and write
00064  * any file that the PostgreSQL server has permission to access.  If
00065  * you turn this on, don't say we didn't warn you.
00066  */
00067 /* #define ALLOW_DANGEROUS_LO_FUNCTIONS */
00068 
00069 /*
00070  * MAXPGPATH: standard size of a pathname buffer in PostgreSQL (hence,
00071  * maximum usable pathname length is one less).
00072  *
00073  * We'd use a standard system header symbol for this, if there weren't
00074  * so many to choose from: MAXPATHLEN, MAX_PATH, PATH_MAX are all
00075  * defined by different "standards", and often have different values
00076  * on the same platform!  So we just punt and use a reasonably
00077  * generous setting here.
00078  */
00079 #define MAXPGPATH       1024
00080 
00081 /*
00082  * PG_SOMAXCONN: maximum accept-queue length limit passed to
00083  * listen(2).  You'd think we should use SOMAXCONN from
00084  * <sys/socket.h>, but on many systems that symbol is much smaller
00085  * than the kernel's actual limit.  In any case, this symbol need be
00086  * twiddled only if you have a kernel that refuses large limit values,
00087  * rather than silently reducing the value to what it can handle
00088  * (which is what most if not all Unixen do).
00089  */
00090 #define PG_SOMAXCONN    10000
00091 
00092 /*
00093  * You can try changing this if you have a machine with bytes of
00094  * another size, but no guarantee...
00095  */
00096 #define BITS_PER_BYTE       8
00097 
00098 /*
00099  * Preferred alignment for disk I/O buffers.  On some CPUs, copies between
00100  * user space and kernel space are significantly faster if the user buffer
00101  * is aligned on a larger-than-MAXALIGN boundary.  Ideally this should be
00102  * a platform-dependent value, but for now we just hard-wire it.
00103  */
00104 #define ALIGNOF_BUFFER  32
00105 
00106 /*
00107  * Disable UNIX sockets for certain operating systems.
00108  */
00109 #if defined(WIN32)
00110 #undef HAVE_UNIX_SOCKETS
00111 #endif
00112 
00113 /*
00114  * Define this if your operating system supports link()
00115  */
00116 #if !defined(WIN32) && !defined(__CYGWIN__)
00117 #define HAVE_WORKING_LINK 1
00118 #endif
00119 
00120 /*
00121  * USE_POSIX_FADVISE controls whether Postgres will attempt to use the
00122  * posix_fadvise() kernel call.  Usually the automatic configure tests are
00123  * sufficient, but some older Linux distributions had broken versions of
00124  * posix_fadvise().  If necessary you can remove the #define here.
00125  */
00126 #if HAVE_DECL_POSIX_FADVISE && defined(HAVE_POSIX_FADVISE)
00127 #define USE_POSIX_FADVISE
00128 #endif
00129 
00130 /*
00131  * USE_PREFETCH code should be compiled only if we have a way to implement
00132  * prefetching.  (This is decoupled from USE_POSIX_FADVISE because there
00133  * might in future be support for alternative low-level prefetch APIs.)
00134  */
00135 #ifdef USE_POSIX_FADVISE
00136 #define USE_PREFETCH
00137 #endif
00138 
00139 /*
00140  * This is the default directory in which AF_UNIX socket files are
00141  * placed.  Caution: changing this risks breaking your existing client
00142  * applications, which are likely to continue to look in the old
00143  * directory.  But if you just hate the idea of sockets in /tmp,
00144  * here's where to twiddle it.  You can also override this at runtime
00145  * with the postmaster's -k switch.
00146  */
00147 #define DEFAULT_PGSOCKET_DIR  "/tmp"
00148 
00149 /*
00150  * The random() function is expected to yield values between 0 and
00151  * MAX_RANDOM_VALUE.  Currently, all known implementations yield
00152  * 0..2^31-1, so we just hardwire this constant.  We could do a
00153  * configure test if it proves to be necessary.  CAUTION: Think not to
00154  * replace this with RAND_MAX.  RAND_MAX defines the maximum value of
00155  * the older rand() function, which is often different from --- and
00156  * considerably inferior to --- random().
00157  */
00158 #define MAX_RANDOM_VALUE  (0x7FFFFFFF)
00159 
00160 /*
00161  * Set the format style used by gcc to check printf type functions. We really
00162  * want the "gnu_printf" style set, which includes what glibc uses, such
00163  * as %m for error strings and %lld for 64 bit long longs. But not all gcc
00164  * compilers are known to support it, so we just use "printf" which all
00165  * gcc versions alive are known to support, except on Windows where
00166  * using "gnu_printf" style makes a dramatic difference. Maybe someday
00167  * we'll have a configure test for this, if we ever discover use of more
00168  * variants to be necessary.
00169  */
00170 #ifdef WIN32
00171 #define PG_PRINTF_ATTRIBUTE gnu_printf
00172 #else
00173 #define PG_PRINTF_ATTRIBUTE printf
00174 #endif
00175 
00176 /*
00177  * On PPC machines, decide whether to use the mutex hint bit in LWARX
00178  * instructions.  Setting the hint bit will slightly improve spinlock
00179  * performance on POWER6 and later machines, but does nothing before that,
00180  * and will result in illegal-instruction failures on some pre-POWER4
00181  * machines.  By default we use the hint bit when building for 64-bit PPC,
00182  * which should be safe in nearly all cases.  You might want to override
00183  * this if you are building 32-bit code for a known-recent PPC machine.
00184  */
00185 #ifdef HAVE_PPC_LWARX_MUTEX_HINT    /* must have assembler support in any case */
00186 #if defined(__ppc64__) || defined(__powerpc64__)
00187 #define USE_PPC_LWARX_MUTEX_HINT
00188 #endif
00189 #endif
00190 
00191 /*
00192  * On PPC machines, decide whether to use LWSYNC instructions in place of
00193  * ISYNC and SYNC.  This provides slightly better performance, but will
00194  * result in illegal-instruction failures on some pre-POWER4 machines.
00195  * By default we use LWSYNC when building for 64-bit PPC, which should be
00196  * safe in nearly all cases.
00197  */
00198 #if defined(__ppc64__) || defined(__powerpc64__)
00199 #define USE_PPC_LWSYNC
00200 #endif
00201 
00202 /*
00203  *------------------------------------------------------------------------
00204  * The following symbols are for enabling debugging code, not for
00205  * controlling user-visible features or resource limits.
00206  *------------------------------------------------------------------------
00207  */
00208 
00209 /*
00210  * Define this to cause pfree()'d memory to be cleared immediately, to
00211  * facilitate catching bugs that refer to already-freed values.
00212  * Right now, this gets defined automatically if --enable-cassert.
00213  */
00214 #ifdef USE_ASSERT_CHECKING
00215 #define CLOBBER_FREED_MEMORY
00216 #endif
00217 
00218 /*
00219  * Define this to check memory allocation errors (scribbling on more
00220  * bytes than were allocated).  Right now, this gets defined
00221  * automatically if --enable-cassert.
00222  */
00223 #ifdef USE_ASSERT_CHECKING
00224 #define MEMORY_CONTEXT_CHECKING
00225 #endif
00226 
00227 /*
00228  * Define this to cause palloc()'d memory to be filled with random data, to
00229  * facilitate catching code that depends on the contents of uninitialized
00230  * memory.  Caution: this is horrendously expensive.
00231  */
00232 /* #define RANDOMIZE_ALLOCATED_MEMORY */
00233 
00234 /*
00235  * Define this to force all parse and plan trees to be passed through
00236  * copyObject(), to facilitate catching errors and omissions in
00237  * copyObject().
00238  */
00239 /* #define COPY_PARSE_PLAN_TREES */
00240 
00241 /*
00242  * Enable debugging print statements for lock-related operations.
00243  */
00244 /* #define LOCK_DEBUG */
00245 
00246 /*
00247  * Enable debugging print statements for WAL-related operations; see
00248  * also the wal_debug GUC var.
00249  */
00250 /* #define WAL_DEBUG */
00251 
00252 /*
00253  * Enable tracing of resource consumption during sort operations;
00254  * see also the trace_sort GUC var.  For 8.1 this is enabled by default.
00255  */
00256 #define TRACE_SORT 1
00257 
00258 /*
00259  * Enable tracing of syncscan operations (see also the trace_syncscan GUC var).
00260  */
00261 /* #define TRACE_SYNCSCAN */
00262 
00263 /*
00264  * Other debug #defines (documentation, anyone?)
00265  */
00266 /* #define HEAPDEBUGALL */
00267 /* #define ACLDEBUG */
00268 /* #define RTDEBUG */