First, compile the source code use ./configure –prefix=XXXX –enable-debug && CFLAGS=-O0
then make and make install.
IF you want to RESTART PG
Detected if there is an instance of Postgre server. If there is, kill it. use
1 2 3
to detect the pocess of postgresql and kill it.
1 2 3 4
here DATADIR and postgresqlDIR are your own directory.
IF you don’t want to RESTART PG
1 2 3 4 5 6 7
to test. Here test is your database name.
IF you want to debug contrib
make && make install in contrib/yourdir
then go to gdb to file your shard lib to load symbol. Here XXX.so is your contrib share lib.
if not, when you use break somefunction, it will report:
No symbol table is loaded. Use the “file” command. Make breakpoint pending on future shared library load? (y or [n])