Re: trivial patch: show SIREAD pids in pg_locks

Kevin Grittner <kevin.grittner@wicourts.gov>

From: "Kevin Grittner" <Kevin.Grittner@wicourts.gov>
To: "Dan Ports" <drkp@csail.mit.edu>,<pgsql-hackers@postgresql.org>
Date: 2011-04-01T17:20:25Z
Lists: pgsql-hackers
Dan Ports <drkp@csail.mit.edu> wrote:
> While looking into a SSI bug, I noticed that we don't actually
> display the pid of the holding transaction, even though we have
> that information available.
 
I thought we already had that, but clearly I was mistaken.
 
> The attached patch fixes that.
> 
> One note is that it will show the pid of the backend that executed
> the transaction, even if that transaction has already committed. I
> have no particular opinion about whether it's more useful to do
> that or return null, so went with the smallest change. (The pid is
> null for PREPARED or summarized transactions).
 
The patch looks good to me and a quick test shows the expected
behavior.  No warnings.  Regression tests pass.
 
I guess the question is whether it's OK to include this during the
alpha testing phase.  Even though it's a little bit of a stretch to
call it a bug, the argument could be made that omitting information
which all the other rows in the view have is an inconsistency which
borders on being a bug.  The small size and verifiable safety of the
patch work in its favor.
 
-Kevin