]> granicus.if.org Git - postgresql/commitdiff
Include pid in pg_lock_status() results even for SIREAD locks.
authorRobert Haas <rhaas@postgresql.org>
Mon, 4 Apr 2011 17:20:18 +0000 (13:20 -0400)
committerRobert Haas <rhaas@postgresql.org>
Mon, 4 Apr 2011 17:23:43 +0000 (13:23 -0400)
Dan Ports

src/backend/utils/adt/lockfuncs.c

index c6c948ce5e77fefa676caf8bd51c9258a338a990..6d7d4f4fb0f3990867ab65ee6ce1231138d9594d 100644 (file)
@@ -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