@yawlabs/postgres-mcp 0.6.11 → 0.6.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -7,6 +7,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.6.12] - 2026-05-16
11
+
12
+ ### Fixed
13
+ - `pg_inspect_locks` now resolves `relation` for the common case of row-level
14
+ contention. Previously, `SELECT FOR UPDATE` + `UPDATE` row-level waits
15
+ queued on a `transactionid` lock with `pg_locks.relation = NULL`, so the
16
+ handler returned `relation: null` and gave the agent no hint as to which
17
+ table was contested. A fallback subquery now resolves the contested table
18
+ from the blocker's held write-intent relation locks (RowShareLock,
19
+ RowExclusiveLock, etc.), filtering out plain SELECT's AccessShareLock so
20
+ unrelated tables the blocker only read from don't show up. Closes #5.
21
+
10
22
  ## [0.6.11] - 2026-05-16
11
23
 
12
24
  ### Infrastructure
package/dist/index.js CHANGED
@@ -36391,7 +36391,35 @@ var adminTools = [
36391
36391
  FROM pg_catalog.pg_class c
36392
36392
  JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace
36393
36393
  WHERE c.oid = bl.relation)
36394
- ELSE NULL
36394
+ ELSE (
36395
+ -- transactionid / virtualxid waits have bl.relation = NULL
36396
+ -- because the wait is on the blocker's xid, not on a relation.
36397
+ -- The contested table is usually identifiable from the
36398
+ -- blocker's held write-intent locks: SELECT FOR UPDATE takes
36399
+ -- RowShareLock, UPDATE/INSERT/DELETE take RowExclusiveLock,
36400
+ -- migrations take stronger modes. Filter out the AccessShare
36401
+ -- locks (plain SELECT) the blocker also holds on every table
36402
+ -- they read from -- those aren't the contention source. If
36403
+ -- the blocker has touched multiple write-intent tables in
36404
+ -- their transaction, this is a best-effort hint, not a
36405
+ -- definitive answer; the blocked/blocking queries above let
36406
+ -- the caller disambiguate.
36407
+ SELECT n.nspname || '.' || c.relname
36408
+ FROM pg_catalog.pg_locks blocker_locks
36409
+ JOIN pg_catalog.pg_class c ON c.oid = blocker_locks.relation
36410
+ JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace
36411
+ WHERE blocker_locks.pid = blocking.pid
36412
+ AND blocker_locks.locktype = 'relation'
36413
+ AND blocker_locks.granted
36414
+ AND blocker_locks.mode IN (
36415
+ 'RowShareLock', 'RowExclusiveLock', 'ShareLock',
36416
+ 'ShareRowExclusiveLock', 'ShareUpdateExclusiveLock',
36417
+ 'ExclusiveLock', 'AccessExclusiveLock'
36418
+ )
36419
+ AND n.nspname NOT IN ('pg_catalog', 'information_schema')
36420
+ ORDER BY n.nspname, c.relname
36421
+ LIMIT 1
36422
+ )
36395
36423
  END AS relation,
36396
36424
  bl.locktype AS lock_type
36397
36425
  FROM pg_catalog.pg_locks bl
@@ -37550,7 +37578,7 @@ function compareVersions(a, b) {
37550
37578
  }
37551
37579
 
37552
37580
  // src/index.ts
37553
- var version2 = true ? "0.6.11" : (await null).createRequire(import.meta.url)("../package.json").version;
37581
+ var version2 = true ? "0.6.12" : (await null).createRequire(import.meta.url)("../package.json").version;
37554
37582
  var subcommand = process.argv[2];
37555
37583
  if (subcommand === "version" || subcommand === "--version") {
37556
37584
  console.log(version2);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yawlabs/postgres-mcp",
3
- "version": "0.6.11",
3
+ "version": "0.6.12",
4
4
  "mcpName": "io.github.YawLabs/postgres-mcp",
5
5
  "description": "PostgreSQL MCP server - query, schema introspection, explain, and health checks for AI assistants",
6
6
  "license": "MIT",