pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andrew Sullivan <andrew@libertyrms.info>
Cc: pgsql-performance@postgresql.org
Subject: Re: Finding the PID keeping a transaction open
Date: Tue, 25 Mar 2003 09:37:41 -0500
Message-ID: <28390.1048603061@sss.pgh.pa.us> (raw)
In-Reply-To: <20030325081233.B18817@mail.libertyrms.com>
References: <20030325081233.B18817@mail.libertyrms.com>

Andrew Sullivan <andrew@libertyrms.info> writes:
> What I'm trying to figure out is whether there is a way to learn
> which pids are responsible for the long-running transaction(s) that
> touch(es) the candidate tables.

In 7.3 you could look at the pg_locks system view, but I can't think
of any reasonable way to do it in 7.2 :-(

> I think there must be a way with gdb, but I'm stumped.

The lock structures are arcane enough that manual examination with gdb
would take many minutes --- which you'd have to do with the LockMgr lock
held to keep them from changing underneath you.  This seems quite
unworkable for a production database ...

It's conceivable that some version of the pg_locks code could be
back-ported to 7.2 --- you'd have to settle for dumping the info to
the log, probably, due to lack of table-function support, but it
could be done.

			regards, tom lane




view thread (3+ messages)  latest in thread

Message-ID: <28390.1048603061@sss.pgh.pa.us>
Permalink:  ../28390.1048603061@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/28390.1048603061@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-performance@postgresql.org
  Cc: tgl@sss.pgh.pa.us, andrew@libertyrms.info
  Subject: Re: Finding the PID keeping a transaction open
  In-Reply-To: <28390.1048603061@sss.pgh.pa.us>
  References: <20030325081233.B18817@mail.libertyrms.com> <28390.1048603061@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox