I have written a C extension library for PG, using V1 calling convention. My db is ver 8.4.
I have successfully created the new functions.
However, when I invoke my new functions, it crashes the server, with the following message sent to the console:
The connection to the server was lost. Attempting reset: Failed.
The server log contains the line:
server process (PID 14751) was terminated by signal 11: Segmentation fault
I want to attach gdb to the postgres process, and see if I can obtain a stack trace, to help me start debugging. However, when I run
ps aux | grep postgres
to try to locate the postgres process, there seems to be several processes called postgres.
How may I correctly identify the postgres server process (after restarted) for debugging purposes as described above?
I just found out the answer to this. The database name is also part of the ps aux output.
For example:
The process id in this case is 14856