I have been strugglling to build posqlgresql 9.1 with trace_locks on so I can check the memory addresses used by the locks, but after a couple of days effort, I still haven’t made any progress.
to compile:
./configure --prefix=/usr/local/pgsql --enable-depend --enable-cassert --enable-debug
make
make install
According to postgresql documentation, LOCK_DEBUG should be set at compile time,
./configure --prefix=/usr/local/pgsql --enable-depend --enable-cassert --enable-debug LOCK_DEBUG='on'
but it doesn’t seem like working.
Please help! Thanks!!!
I think you just want to get
-DLOCK_DEBUGinto the compiler flags, try it like this:I added the backslashes to make it easier to read, you can use this if you want it all in one line:
You can find examples of similar things in the installation documentation, just search for “CFLAGS”: