Re: Who is locking me? - Mailing list pgsql-general

From Tom Lane
Subject Re: Who is locking me?
Date
Msg-id 16029.1268941035@sss.pgh.pa.us
Whole thread Raw
In response to Re: Who is locking me?  (Bill Moran <wmoran@potentialtech.com>)
List pgsql-general
Bill Moran <wmoran@potentialtech.com> writes:
> In response to "Abraham, Danny" <danny_abraham@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

pgsql-general by date:

Previous
From: Justin Graf
Date:
Subject:
Next
From: Ovnicraft
Date:
Subject: Re: accounting package