Bill Moran <wmo...@potentialtech.com> writes:
> In response to "Abraham, Danny" <danny_abra...@bmc.com>:
>> - Can I retrieve the Client PID somewhere (then by process name I will dive 
>> into the code).

> If you're on a POSIX system, you can use netstat to find out the details of
> the socket the backend is connected to.

Looking at all the columns of pg_stat_activity, rather than just some of
them, should provide the client address and port number.  I guess you'd
still need netstat or lsof or some other tool to find out what process
owns that port though.

It's quite peculiar that the given query hangs though.  Right offhand,
the only thing I can think of that might block it is an exclusive lock
on pg_proc, or one of the other system catalogs that the parser has to
consult to process the query.  It's *extremely* bad form for a client
to take such a lock at all, much less sit on it while doing nothing.

                        regards, tom lane

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

Reply via email to