I want to set wal_debug on to my postgresql.conf so that I can see what’s happening with the write-ahead log (WAL).
I compiled PostgreSQL with --enable-debug:
./configure --prefix=/usr/local/pgsql --enable-nls --with-perl --with-libxml --with-pam --enable-debug
and added this to the buttom of postgresql.conf
wal_debug = on
When I tried to start postgres the server complains:
$ pg_ctl start
server starting
FATAL: unrecognized configuration parameter "wal_debug"
What am I missing?
When configuring, pass
-DWAL_DEBUGin theCPPFLAGSto./configure, eg:All
--enable-debugdoes (in Pg) is tell the compiler to emit an additional section in each compilation unit that contains debug info – function parameters, local variable info, etc. This info allows useful backtraces to be produced when debugging withgdb, makes it easier to step through the program, etc.Other debug and test options are controlled by pre-processor definitions like
WAL_DEBUG, which are tested for with conditional compilation directives like#ifdef WAL_DEBUGwithin the source code. A few of these have configure flags, like--enable-cassert, but for most you’re just expected to pass the preprocessor flag yourself.As pointed out by dezso, see: