WHo is locking me?

WHo is locking me?

am 18.03.2010 20:02:10 von danny_abraham

Hi,

A process hangs forever.
When using this query...

SELECT pg_stat_get_backend_pid(s.backendid) AS procpid,
pg_stat_get_backend_activity(s.backendid) AS current_query
FROM (SELECT pg_stat_get_backend_idset() AS backendid) AS s
where pg_stat_get_backend_activity(s.backendid) not like ' and pg_stat_get_backend_activity(s.backendid) not like '';


I get...


procpid | current_query
---------+-------------------------------------------------- ---------------=
----
26702 | SELECT pg_stat_get_backend_pid(s.backendid) AS procpid,
: pg_stat_get_backend_activity(s.backendid) AS current_query
: FROM (SELECT pg_stat_get_backend_idset() AS backendid) AS s
: where pg_stat_get_backend_activity(s.backendid) not like ' f%'
: and pg_stat_get_backend_activity(s.backendid) not like '';
21282 | update cmr_lastno set lastisn=3Dlastisn+1 where tablename=3D'DAN=
NY';
25936 | in transaction <== This is the locker=20

And the question:
- What exactly is the locker doing?
- Can I retrieve the Client PID somewhere (then by process name I will dive=
into the code).

Thanks a lot

Danny Abraham
BMC Software
CTM&D Business Unit
972-52-4286-513
danny_abraham@bmc.com


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

Re: WHo is locking me?

am 18.03.2010 22:02:33 von Kevin Grittner

"Abraham, Danny" wrote:

> procpid | current_query
>
---------+-------------------------------------------------- -------------------
> 25936 | in transaction <== This is the locker

> - What exactly is the locker doing?

At the time you ran that, it wasn't doing anything in the database,
but it had not committed or rolled back the transaction it had
previously started.

> - Can I retrieve the Client PID somewhere (then by process name I
> will dive into the code).

If you're on Linux and this is a TCP connection, netstat should make
that easy. Are you?

-Kevin

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