]> begriffs open source - ai-pg/blob - full-docs/txt/runtime-config-developer.txt
Convert HTML docs to more streamlined TXT
[ai-pg] / full-docs / txt / runtime-config-developer.txt
1
2 19.17. Developer Options #
3
4    The following parameters are intended for developer testing, and should
5    never be used on a production database. However, some of them can be
6    used to assist with the recovery of severely damaged databases. As
7    such, they have been excluded from the sample postgresql.conf file.
8    Note that many of these parameters require special source compilation
9    flags to work at all.
10
11    allow_in_place_tablespaces (boolean) #
12           Allows tablespaces to be created as directories inside
13           pg_tblspc, when an empty location string is provided to the
14           CREATE TABLESPACE command. This is intended to allow testing
15           replication scenarios where primary and standby servers are
16           running on the same machine. Such directories are likely to
17           confuse backup tools that expect to find only symbolic links in
18           that location. Only superusers and users with the appropriate
19           SET privilege can change this setting.
20
21    allow_system_table_mods (boolean) #
22           Allows modification of the structure of system tables as well as
23           certain other risky actions on system tables. This is otherwise
24           not allowed even for superusers. Ill-advised use of this setting
25           can cause irretrievable data loss or seriously corrupt the
26           database system. Only superusers and users with the appropriate
27           SET privilege can change this setting.
28
29    backtrace_functions (string) #
30           This parameter contains a comma-separated list of C function
31           names. If an error is raised and the name of the internal C
32           function where the error happens matches a value in the list,
33           then a backtrace is written to the server log together with the
34           error message. This can be used to debug specific areas of the
35           source code.
36
37           Backtrace support is not available on all platforms, and the
38           quality of the backtraces depends on compilation options.
39
40           Only superusers and users with the appropriate SET privilege can
41           change this setting.
42
43    debug_copy_parse_plan_trees (boolean) #
44           Enabling this forces all parse and plan trees to be passed
45           through copyObject(), to facilitate catching errors and
46           omissions in copyObject(). The default is off.
47
48           This parameter is only available when DEBUG_NODE_TESTS_ENABLED
49           was defined at compile time (which happens automatically when
50           using the configure option --enable-cassert).
51
52    debug_discard_caches (integer) #
53           When set to 1, each system catalog cache entry is invalidated at
54           the first possible opportunity, whether or not anything that
55           would render it invalid really occurred. Caching of system
56           catalogs is effectively disabled as a result, so the server will
57           run extremely slowly. Higher values run the cache invalidation
58           recursively, which is even slower and only useful for testing
59           the caching logic itself. The default value of 0 selects normal
60           catalog caching behavior.
61
62           This parameter can be very helpful when trying to trigger
63           hard-to-reproduce bugs involving concurrent catalog changes, but
64           it is otherwise rarely needed. See the source code files inval.c
65           and pg_config_manual.h for details.
66
67           This parameter is supported when DISCARD_CACHES_ENABLED was
68           defined at compile time (which happens automatically when using
69           the configure option --enable-cassert). In production builds,
70           its value will always be 0 and attempts to set it to another
71           value will raise an error.
72
73    debug_io_direct (string) #
74           Ask the kernel to minimize caching effects for relation data and
75           WAL files using O_DIRECT (most Unix-like systems), F_NOCACHE
76           (macOS) or FILE_FLAG_NO_BUFFERING (Windows).
77
78           May be set to an empty string (the default) to disable use of
79           direct I/O, or a comma-separated list of operations that should
80           use direct I/O. The valid options are data for main data files,
81           wal for WAL files, and wal_init for WAL files when being
82           initially allocated.
83
84           Some operating systems and file systems do not support direct
85           I/O, so non-default settings may be rejected at startup or cause
86           errors.
87
88           Currently this feature reduces performance, and is intended for
89           developer testing only.
90
91    debug_parallel_query (enum) #
92           Allows the use of parallel queries for testing purposes even in
93           cases where no performance benefit is expected. The allowed
94           values of debug_parallel_query are off (use parallel mode only
95           when it is expected to improve performance), on (force parallel
96           query for all queries for which it is thought to be safe), and
97           regress (like on, but with additional behavior changes as
98           explained below).
99
100           More specifically, setting this value to on will add a Gather
101           node to the top of any query plan for which this appears to be
102           safe, so that the query runs inside of a parallel worker. Even
103           when a parallel worker is not available or cannot be used,
104           operations such as starting a subtransaction that would be
105           prohibited in a parallel query context will be prohibited unless
106           the planner believes that this will cause the query to fail. If
107           failures or unexpected results occur when this option is set,
108           some functions used by the query may need to be marked PARALLEL
109           UNSAFE (or, possibly, PARALLEL RESTRICTED).
110
111           Setting this value to regress has all of the same effects as
112           setting it to on plus some additional effects that are intended
113           to facilitate automated regression testing. Normally, messages
114           from a parallel worker include a context line indicating that,
115           but a setting of regress suppresses this line so that the output
116           is the same as in non-parallel execution. Also, the Gather nodes
117           added to plans by this setting are hidden in EXPLAIN output so
118           that the output matches what would be obtained if this setting
119           were turned off.
120
121    debug_raw_expression_coverage_test (boolean) #
122           Enabling this forces all raw parse trees for DML statements to
123           be scanned by raw_expression_tree_walker(), to facilitate
124           catching errors and omissions in that function. The default is
125           off.
126
127           This parameter is only available when DEBUG_NODE_TESTS_ENABLED
128           was defined at compile time (which happens automatically when
129           using the configure option --enable-cassert).
130
131    debug_write_read_parse_plan_trees (boolean) #
132           Enabling this forces all parse and plan trees to be passed
133           through outfuncs.c/readfuncs.c, to facilitate catching errors
134           and omissions in those modules. The default is off.
135
136           This parameter is only available when DEBUG_NODE_TESTS_ENABLED
137           was defined at compile time (which happens automatically when
138           using the configure option --enable-cassert).
139
140    ignore_system_indexes (boolean) #
141           Ignore system indexes when reading system tables (but still
142           update the indexes when modifying the tables). This is useful
143           when recovering from damaged system indexes. This parameter
144           cannot be changed after session start.
145
146    post_auth_delay (integer) #
147           The amount of time to delay when a new server process is
148           started, after it conducts the authentication procedure. This is
149           intended to give developers an opportunity to attach to the
150           server process with a debugger. If this value is specified
151           without units, it is taken as seconds. A value of zero (the
152           default) disables the delay. This parameter cannot be changed
153           after session start.
154
155    pre_auth_delay (integer) #
156           The amount of time to delay just after a new server process is
157           forked, before it conducts the authentication procedure. This is
158           intended to give developers an opportunity to attach to the
159           server process with a debugger to trace down misbehavior in
160           authentication. If this value is specified without units, it is
161           taken as seconds. A value of zero (the default) disables the
162           delay. This parameter can only be set in the postgresql.conf
163           file or on the server command line.
164
165    trace_notify (boolean) #
166           Generates a great amount of debugging output for the LISTEN and
167           NOTIFY commands. client_min_messages or log_min_messages must be
168           DEBUG1 or lower to send this output to the client or server
169           logs, respectively.
170
171    trace_sort (boolean) #
172           If on, emit information about resource usage during sort
173           operations.
174
175    trace_locks (boolean) #
176           If on, emit information about lock usage. Information dumped
177           includes the type of lock operation, the type of lock and the
178           unique identifier of the object being locked or unlocked. Also
179           included are bit masks for the lock types already granted on
180           this object as well as for the lock types awaited on this
181           object. For each lock type a count of the number of granted
182           locks and waiting locks is also dumped as well as the totals. An
183           example of the log file output is shown here:
184
185 LOG:  LockAcquire: new: lock(0xb7acd844) id(24688,24696,0,0,0,1)
186       grantMask(0) req(0,0,0,0,0,0,0)=0 grant(0,0,0,0,0,0,0)=0
187       wait(0) type(AccessShareLock)
188 LOG:  GrantLock: lock(0xb7acd844) id(24688,24696,0,0,0,1)
189       grantMask(2) req(1,0,0,0,0,0,0)=1 grant(1,0,0,0,0,0,0)=1
190       wait(0) type(AccessShareLock)
191 LOG:  UnGrantLock: updated: lock(0xb7acd844) id(24688,24696,0,0,0,1)
192       grantMask(0) req(0,0,0,0,0,0,0)=0 grant(0,0,0,0,0,0,0)=0
193       wait(0) type(AccessShareLock)
194 LOG:  CleanUpLock: deleting: lock(0xb7acd844) id(24688,24696,0,0,0,1)
195       grantMask(0) req(0,0,0,0,0,0,0)=0 grant(0,0,0,0,0,0,0)=0
196       wait(0) type(INVALID)
197
198           Details of the structure being dumped may be found in
199           src/include/storage/lock.h.
200
201           This parameter is only available if the LOCK_DEBUG macro was
202           defined when PostgreSQL was compiled.
203
204    trace_lwlocks (boolean) #
205           If on, emit information about lightweight lock usage.
206           Lightweight locks are intended primarily to provide mutual
207           exclusion of access to shared-memory data structures.
208
209           This parameter is only available if the LOCK_DEBUG macro was
210           defined when PostgreSQL was compiled.
211
212    trace_userlocks (boolean) #
213           If on, emit information about user lock usage. Output is the
214           same as for trace_locks, only for advisory locks.
215
216           This parameter is only available if the LOCK_DEBUG macro was
217           defined when PostgreSQL was compiled.
218
219    trace_lock_oidmin (integer) #
220           If set, do not trace locks for tables below this OID (used to
221           avoid output on system tables).
222
223           This parameter is only available if the LOCK_DEBUG macro was
224           defined when PostgreSQL was compiled.
225
226    trace_lock_table (integer) #
227           Unconditionally trace locks on this table (OID).
228
229           This parameter is only available if the LOCK_DEBUG macro was
230           defined when PostgreSQL was compiled.
231
232    debug_deadlocks (boolean) #
233           If set, dumps information about all current locks when a
234           deadlock timeout occurs.
235
236           This parameter is only available if the LOCK_DEBUG macro was
237           defined when PostgreSQL was compiled.
238
239    log_btree_build_stats (boolean) #
240           If set, logs system resource usage statistics (memory and CPU)
241           on various B-tree operations.
242
243           This parameter is only available if the BTREE_BUILD_STATS macro
244           was defined when PostgreSQL was compiled.
245
246    wal_consistency_checking (string) #
247           This parameter is intended to be used to check for bugs in the
248           WAL redo routines. When enabled, full-page images of any buffers
249           modified in conjunction with the WAL record are added to the
250           record. If the record is subsequently replayed, the system will
251           first apply each record and then test whether the buffers
252           modified by the record match the stored images. In certain cases
253           (such as hint bits), minor variations are acceptable, and will
254           be ignored. Any unexpected differences will result in a fatal
255           error, terminating recovery.
256
257           The default value of this setting is the empty string, which
258           disables the feature. It can be set to all to check all records,
259           or to a comma-separated list of resource managers to check only
260           records originating from those resource managers. Currently, the
261           supported resource managers are heap, heap2, btree, hash, gin,
262           gist, sequence, spgist, brin, and generic. Extensions may define
263           additional resource managers. Only superusers and users with the
264           appropriate SET privilege can change this setting.
265
266    wal_debug (boolean) #
267           If on, emit WAL-related debugging output. This parameter is only
268           available if the WAL_DEBUG macro was defined when PostgreSQL was
269           compiled.
270
271    ignore_checksum_failure (boolean) #
272           Only has effect if -k are enabled.
273
274           Detection of a checksum failure during a read normally causes
275           PostgreSQL to report an error, aborting the current transaction.
276           Setting ignore_checksum_failure to on causes the system to
277           ignore the failure (but still report a warning), and continue
278           processing. This behavior may cause crashes, propagate or hide
279           corruption, or other serious problems. However, it may allow you
280           to get past the error and retrieve undamaged tuples that might
281           still be present in the table if the block header is still sane.
282           If the header is corrupt an error will be reported even if this
283           option is enabled. The default setting is off. Only superusers
284           and users with the appropriate SET privilege can change this
285           setting.
286
287    zero_damaged_pages (boolean) #
288           Detection of a damaged page header normally causes PostgreSQL to
289           report an error, aborting the current transaction. Setting
290           zero_damaged_pages to on causes the system to instead report a
291           warning, zero out the damaged page in memory, and continue
292           processing. This behavior will destroy data, namely all the rows
293           on the damaged page. However, it does allow you to get past the
294           error and retrieve rows from any undamaged pages that might be
295           present in the table. It is useful for recovering data if
296           corruption has occurred due to a hardware or software error. You
297           should generally not set this on until you have given up hope of
298           recovering data from the damaged pages of a table. Zeroed-out
299           pages are not forced to disk so it is recommended to recreate
300           the table or the index before turning this parameter off again.
301           The default setting is off. Only superusers and users with the
302           appropriate SET privilege can change this setting.
303
304    ignore_invalid_pages (boolean) #
305           If set to off (the default), detection of WAL records having
306           references to invalid pages during recovery causes PostgreSQL to
307           raise a PANIC-level error, aborting the recovery. Setting
308           ignore_invalid_pages to on causes the system to ignore invalid
309           page references in WAL records (but still report a warning), and
310           continue the recovery. This behavior may cause crashes, data
311           loss, propagate or hide corruption, or other serious problems.
312           However, it may allow you to get past the PANIC-level error, to
313           finish the recovery, and to cause the server to start up. The
314           parameter can only be set at server start. It only has effect
315           during recovery or in standby mode.
316
317    jit_debugging_support (boolean) #
318           If LLVM has the required functionality, register generated
319           functions with GDB. This makes debugging easier. The default
320           setting is off. This parameter can only be set at server start.
321
322    jit_dump_bitcode (boolean) #
323           Writes the generated LLVM IR out to the file system, inside
324           data_directory. This is only useful for working on the internals
325           of the JIT implementation. The default setting is off. Only
326           superusers and users with the appropriate SET privilege can
327           change this setting.
328
329    jit_expressions (boolean) #
330           Determines whether expressions are JIT compiled, when JIT
331           compilation is activated (see Section 30.2). The default is on.
332
333    jit_profiling_support (boolean) #
334           If LLVM has the required functionality, emit the data needed to
335           allow perf to profile functions generated by JIT. This writes
336           out files to ~/.debug/jit/; the user is responsible for
337           performing cleanup when desired. The default setting is off.
338           This parameter can only be set at server start.
339
340    jit_tuple_deforming (boolean) #
341           Determines whether tuple deforming is JIT compiled, when JIT
342           compilation is activated (see Section 30.2). The default is on.
343
344    remove_temp_files_after_crash (boolean) #
345           When set to on, which is the default, PostgreSQL will
346           automatically remove temporary files after a backend crash. If
347           disabled, the files will be retained and may be used for
348           debugging, for example. Repeated crashes may however result in
349           accumulation of useless files. This parameter can only be set in
350           the postgresql.conf file or on the server command line.
351
352    send_abort_for_crash (boolean) #
353           By default, after a backend crash the postmaster will stop
354           remaining child processes by sending them SIGQUIT signals, which
355           permits them to exit more-or-less gracefully. When this option
356           is set to on, SIGABRT is sent instead. That normally results in
357           production of a core dump file for each such child process. This
358           can be handy for investigating the states of other processes
359           after a crash. It can also consume lots of disk space in the
360           event of repeated crashes, so do not enable this on systems you
361           are not monitoring carefully. Beware that no support exists for
362           cleaning up the core file(s) automatically. This parameter can
363           only be set in the postgresql.conf file or on the server command
364           line.
365
366    send_abort_for_kill (boolean) #
367           By default, after attempting to stop a child process with
368           SIGQUIT, the postmaster will wait five seconds and then send
369           SIGKILL to force immediate termination. When this option is set
370           to on, SIGABRT is sent instead of SIGKILL. That normally results
371           in production of a core dump file for each such child process.
372           This can be handy for investigating the states of “stuck” child
373           processes. It can also consume lots of disk space in the event
374           of repeated crashes, so do not enable this on systems you are
375           not monitoring carefully. Beware that no support exists for
376           cleaning up the core file(s) automatically. This parameter can
377           only be set in the postgresql.conf file or on the server command
378           line.
379
380    debug_logical_replication_streaming (enum) #
381           The allowed values are buffered and immediate. The default is
382           buffered. This parameter is intended to be used to test logical
383           decoding and replication of large transactions. The effect of
384           debug_logical_replication_streaming is different for the
385           publisher and subscriber:
386
387           On the publisher side, debug_logical_replication_streaming
388           allows streaming or serializing changes immediately in logical
389           decoding. When set to immediate, stream each change if the
390           streaming option of CREATE SUBSCRIPTION is enabled, otherwise,
391           serialize each change. When set to buffered, the decoding will
392           stream or serialize changes when logical_decoding_work_mem is
393           reached.
394
395           On the subscriber side, if the streaming option is set to
396           parallel, debug_logical_replication_streaming can be used to
397           direct the leader apply worker to send changes to the shared
398           memory queue or to serialize all changes to the file. When set
399           to buffered, the leader sends changes to parallel apply workers
400           via a shared memory queue. When set to immediate, the leader
401           serializes all changes to files and notifies the parallel apply
402           workers to read and apply them at the end of the transaction.