patch-ssi-pid-in-pg_locks.diff

text/x-diff

Filename: patch-ssi-pid-in-pg_locks.diff
Type: text/x-diff
Part: 0
Message: trivial patch: show SIREAD pids in pg_locks

Patch

Same data as JSON: GET /api/v1/attachments/:id/patch the parsed metadata as JSON — format, series position, per-file stats; never the diff bytes. API reference →
Format: unified
File+
src/backend/utils/adt/lockfuncs.c 4 1
diff --git a/src/backend/utils/adt/lockfuncs.c b/src/backend/utils/adt/lockfuncs.c
index c6c948c..6d7d4f4 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