Contents
debug_discard_caches
debug_discard_caches
is a configuration parameter instructing PostgreSQL to invalidate each system catalog cache entry at the first possible opportunity.
debug_discard_caches
was added in PostgreSQL 14.
Default
The default value for debug_discard_caches
is: 0
. See the Usage section for exceptions.
Note that debug_discard_caches
can only be enabled if PostgreSQL was compiled with the --enable-cassert
option, or if DISCARD_CACHES_ENABLED
was manually set. Otherwise it is not possible to change the setting.
Usage
debug_discard_caches
was introduced to obviate the need to set CLOBBER_CACHE_ALWAYS
when building PostgreSQL, and makes it possible to dynamically enable/disable the setting.
For backwards compatibility, debug_discard_caches
will be set to 1
if CLOBBER_CACHE_ALWAYS
was defined, or 3
if CLOBBER_CACHE_RECURSIV
E was defined.
From PostgreSQL 14 the option --clobber-cache
can be provided to initdb
to bootstrap backends with debug_discard_caches
will be set to 1
.
Change history
References
- PostgreSQL 14 documentation: debug_discard_caches