Shawn wrote:
> strace of long-running query pid 6819 loops like this:
>
> sendto(10, "<query stuff removed>" NULL, 0) = ? ERESTARTSYS (To be
> restarted if SA_RESTART is set)
> --- SIGUSR1 {si_signo=SIGUSR1, si_code=SI_USER, si_pid=8719,
> si_uid=3001} ---
> rt_sigreturn()
>
> Where pid 6819 is a long (running for 2 days) running query. In
> pg_stat_activity, it was still listed as "active". The query had a horrible
> execution plan and it was being executed via a python script. I couldn't
> pg_terminate_backend the connection. I didn't try to "kill -9" it due to
> all the warnings about that and I felt I had something special here. I
> attached the debugger.
Did you happen to grab a stack trace of PID 6819?
--
Álvaro Herrera http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services