Chapter 31. Troubleshooting
Postgres Pro offers the ability to dump the state of a backend process, which can be useful for diagnostic and debugging purposes, by enabling thecrash_info configuration parameter. Then the dump state file can be generated in one of the following ways:
By sending the signal
40
(also known as the diagnostic dump signal):kill -40
backend_pid
Using the
pg_diagdump()
function:SELECT pg_diagdump(
backend_pid
);
Herebackend_pid
is the process ID of the backend process to dump.
As a result,Postgres Pro will write the state dump to a file in the$PGDATA/crash_info
directory by default or in the directory specified in thecrash_info_location configuration parameter. The file will be named following this pattern:crash_
. You can set the data sources to provide data for a crash dump in thecrash_info_dump configuration parameter.file_id
_pidpid
.state
The below example shows how to generate and inspect the state dump file for the backend with PID23111
:
-- Generate the state dump fileSELECT pg_diagdump(23111);-- Inspect crash_info directory and its contentsSELECT pg_ls_dir('crash_info');-- Read the contents of the state dump fileSELECT pg_read_file('crash_info/crash_1722943138419104_pid23111.state');