From a0e50e698beb89a8ec203303581e464a5f69fc41 Mon Sep 17 00:00:00 2001 From: Robert Haas Date: Mon, 4 Apr 2011 13:20:18 -0400 Subject: [PATCH] Include pid in pg_lock_status() results even for SIREAD locks. Dan Ports --- src/backend/utils/adt/lockfuncs.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/backend/utils/adt/lockfuncs.c b/src/backend/utils/adt/lockfuncs.c index c6c948ce5e..6d7d4f4fb0 100644 --- a/src/backend/utils/adt/lockfuncs.c +++ b/src/backend/utils/adt/lockfuncs.c @@ -368,7 +368,10 @@ pg_lock_status(PG_FUNCTION_ARGS) /* lock holder */ values[10] = VXIDGetDatum(xact->vxid.backendId, xact->vxid.localTransactionId); - nulls[11] = true; /* pid */ + if (xact->pid != 0) + values[11] = Int32GetDatum(xact->pid); + else + nulls[11] = true; /* * Lock mode. Currently all predicate locks are SIReadLocks, which are