On Mon, Feb 23, 2009 at 4:49 PM, Gregory Stark <stark(at)enterprisedb(dot)com> wrote:
> Robert Haas <robertmhaas(at)gmail(dot)com> writes:
>
>> Attach to the backend with gdb. Then you can get a backtrace, esp. if
>> you've built with --enable-debug.
>>
>> It may be helpful to use lsof to figure out which backend your psql
>> session is connected to.
>
> select backend_pid();
>
> is pretty handy for this. Though if you have the backend crashing on every
> plan it may not help...
pg_backend_pid()
...Robert