{"schema": "pgtrue.report/1", "url": "https://pgtrue.postgres.ai/shared/brief/ea1fd3f3-90d2-4103-ae12-0c08fdb61c75", "published": "2026-10-21T04:06:02Z", "publisher": "PostgresAI", "article": {"title": "Resolve Amazon Aurora PostgreSQL lock contention with Database Insights: Part 2 | Amazon Web Services", "url": "https://aws.amazon.com/blogs/database/resolve-amazon-aurora-postgresql-lock-contention-with-database-insights-part-2", "date_published": "2026-09-14T16:02:16Z", "author": "Sameer Kumar and Sabesan Manivasakan", "publisher": "AWS Database Blog"}, "grade": "B", "axes": [{"axis": "Factual", "summary": "B+ \u00b7 1 wrong of 22 checked \u00b7 0 caveats"}, {"axis": "Applicable", "summary": "A \u00b7 0 wrong of 8 checked \u00b7 2 caveats"}, {"axis": "Consistent", "summary": "A \u00b7 0 wrong of 22 checked \u00b7 2 caveats"}, {"axis": "Transparent", "summary": "C \u00b7 0 wrong of 2 checked \u00b7 0 caveats \u00b7 reproducibility: C (no hardware)"}, {"axis": "Safe", "summary": "not applicable"}], "findings": [{"anchor": "F3", "url": "https://pgtrue.postgres.ai/shared/brief/ea1fd3f3-90d2-4103-ae12-0c08fdb61c75#F3", "claim": "\u2026Both functions require rds_superuser privileges\u2026", "title": "Backend signaling does not always require rds_superuser", "explanation": "The cited service documentation permits signaling another session owned by the same database user. It also permits members of pg_signal_backend. Requiring rds_superuser for every cancellation or termination overstates the privilege requirement.", "verdict": "False", "sources": [{"url": "https://repost.aws/knowledge-center/rds-cancel-long-running-queries", "label": "https://repost.aws/knowledge-center/rds-cancel-long-running-queries"}]}, {"anchor": "F1", "url": "https://pgtrue.postgres.ai/shared/brief/ea1fd3f3-90d2-4103-ae12-0c08fdb61c75#F1", "claim": "\u2026Insert order item after confirming inventory was decremented\u2026", "explanation": "The illustrative pseudocode omits an explicit affected-row check. Its preceding prose requires rollback on zero rows. Its comment requires confirmation before inserting order_items. Implement UPDATE RETURNING or an affected-row check to enforce those instructions. PostgreSQL treats UPDATE 0 as success.", "verdict": "Mostly accurate", "sources": [{"url": "https://github.com/postgres/postgres/blob/083ac033419f690758508e08c1736089384bbee8/doc/src/sgml/ref/update.sgml#L252-L253", "label": "REL_17_11 \u00b7 doc/src/sgml/ref/update.sgml:252-253"}, {"url": "https://github.com/postgres/postgres/blob/083ac033419f690758508e08c1736089384bbee8/doc/src/sgml/mvcc.sgml#L349-L352", "label": "REL_17_11 \u00b7 doc/src/sgml/mvcc.sgml:349-352"}]}, {"anchor": "F2", "url": "https://pgtrue.postgres.ai/shared/brief/ea1fd3f3-90d2-4103-ae12-0c08fdb61c75#F2", "claim": "\u2026which prevents concurrent sessions from accessing the row\u2026", "explanation": "FOR UPDATE acquires ROW SHARE on the table and separately locks selected rows. The row locks block competing writers and lockers, while ordinary SELECT remains possible (doc/src/sgml/mvcc.sgml:1252\u20131255). The example correctly illustrates blocked inventory changes but describes their lock mechanism too broadly.", "verdict": "Mostly accurate", "sources": [{"url": "https://github.com/postgres/postgres/blob/083ac033419f690758508e08c1736089384bbee8/doc/src/sgml/mvcc.sgml#L1252-L1255", "label": "REL_17_11 \u00b7 doc/src/sgml/mvcc.sgml:1252-1255"}, {"url": "https://github.com/postgres/postgres/blob/083ac033419f690758508e08c1736089384bbee8/doc/src/sgml/mvcc.sgml#L937-L938", "label": "REL_17_11 \u00b7 doc/src/sgml/mvcc.sgml:937-938"}]}, {"anchor": "F15", "url": "https://pgtrue.postgres.ai/shared/brief/ea1fd3f3-90d2-4103-ae12-0c08fdb61c75#F15", "claim": "\u2026now that the row is confirmed locked and unchanged\u2026", "explanation": "The illustrative pseudocode omits an explicit affected-row check. Its preceding prose requires rollback on zero rows. Its comment requires confirmation before inserting order_items. Implement UPDATE RETURNING or an affected-row check to enforce those instructions. PostgreSQL treats UPDATE 0 as success.", "verdict": "Mostly accurate", "sources": [{"url": "https://github.com/postgres/postgres/blob/083ac033419f690758508e08c1736089384bbee8/doc/src/sgml/ref/update.sgml#L252-L253", "label": "REL_17_11 \u00b7 doc/src/sgml/ref/update.sgml:252-253"}]}, {"anchor": "F16", "url": "https://pgtrue.postgres.ai/shared/brief/ea1fd3f3-90d2-4103-ae12-0c08fdb61c75#F16", "claim": "\u2026prevents concurrent sessions from accessing the row\u2026", "title": "SELECT FOR UPDATE does not prevent ordinary reads of the row", "explanation": "ROW SHARE is a table-level lock. The accompanying row lock blocks conflicting writers and lockers, while ordinary reads continue. PostgreSQL documents both distinctions in doc/src/sgml/mvcc.sgml:933\u2013949 and 1248\u20131257. Do not treat a locked inventory row as unreadable.", "verdict": "Mostly accurate", "sources": [{"url": "https://github.com/postgres/postgres/blob/083ac033419f690758508e08c1736089384bbee8/doc/src/sgml/mvcc.sgml#L1248-L1257", "label": "REL_17_11 \u00b7 doc/src/sgml/mvcc.sgml:1248-1257"}, {"url": "https://github.com/postgres/postgres/blob/083ac033419f690758508e08c1736089384bbee8/doc/src/sgml/mvcc.sgml#L933-L949", "label": "REL_17_11 \u00b7 doc/src/sgml/mvcc.sgml:933-949"}]}, {"anchor": "F4", "url": "https://pgtrue.postgres.ai/shared/brief/ea1fd3f3-90d2-4103-ae12-0c08fdb61c75#F4", "claim": "\u2026system views ( pg_stat_activity , pg_locks )\u2026", "title": "pg_stat_activity and pg_locks expose current monitoring data", "explanation": "pg_stat_activity exposes backend PIDs and wait events. pg_locks reads lock-manager state through pg_lock_status(). These support current lock investigations. The pid column identifies the backend process.", "verdict": "Accurate", "sources": [{"url": "https://github.com/postgres/postgres/blob/083ac033419f690758508e08c1736089384bbee8/doc/src/sgml/monitoring.sgml#L752-L752", "label": "REL_17_11 \u00b7 doc/src/sgml/monitoring.sgml:752-752"}, {"url": "https://github.com/postgres/postgres/blob/083ac033419f690758508e08c1736089384bbee8/src/backend/catalog/system_views.sql#L881-L882", "label": "REL_17_11 \u00b7 src/backend/catalog/system_views.sql:881-882"}, {"url": "https://github.com/postgres/postgres/blob/083ac033419f690758508e08c1736089384bbee8/src/backend/catalog/system_views.sql#L401-L402", "label": "REL_17_11 \u00b7 src/backend/catalog/system_views.sql:401-402"}, {"url": "https://github.com/postgres/postgres/blob/083ac033419f690758508e08c1736089384bbee8/doc/src/sgml/system-views.sgml#L1328-L1331", "label": "REL_17_11 \u00b7 doc/src/sgml/system-views.sgml:1328-1331"}]}, {"anchor": "F5", "url": "https://pgtrue.postgres.ai/shared/brief/ea1fd3f3-90d2-4103-ae12-0c08fdb61c75#F5", "claim": "\u2026the log_lock_waits parameter\u2026", "title": "log_lock_waits records sufficiently long lock waits", "explanation": "log_lock_waits produces messages after a session waits longer than deadlock_timeout for a lock. It supports the article's reactive contention-monitoring description.", "verdict": "Accurate", "sources": [{"url": "https://github.com/postgres/postgres/blob/083ac033419f690758508e08c1736089384bbee8/doc/src/sgml/config.sgml#L7795-L7797", "label": "REL_17_11 \u00b7 doc/src/sgml/config.sgml:7795-7797"}, {"url": "https://github.com/postgres/postgres/blob/083ac033419f690758508e08c1736089384bbee8/src/backend/utils/misc/guc_tables.c#L1515-L1515", "label": "REL_17_11 \u00b7 src/backend/utils/misc/guc_tables.c:1515-1515"}]}, {"anchor": "F6", "url": "https://pgtrue.postgres.ai/shared/brief/ea1fd3f3-90d2-4103-ae12-0c08fdb61c75#F6", "claim": "\u2026the pg_blocking_pids() function\u2026", "explanation": "pg_blocking_pids returns blocker process IDs for the specified backend (E-25). Blockers include conflicting lock holders and conflicting requests ahead in the wait queue (E-26).", "verdict": "Accurate", "sources": [{"url": "https://github.com/postgres/postgres/blob/083ac033419f690758508e08c1736089384bbee8/doc/src/sgml/func.sgml#L24590-L24593", "label": "REL_17_11 \u00b7 doc/src/sgml/func.sgml:24590-24593"}, {"url": "https://github.com/postgres/postgres/blob/083ac033419f690758508e08c1736089384bbee8/src/backend/utils/adt/lockfuncs.c#L449-L451", "label": "REL_17_11 \u00b7 src/backend/utils/adt/lockfuncs.c:449-451"}]}, {"anchor": "F7", "url": "https://pgtrue.postgres.ai/shared/brief/ea1fd3f3-90d2-4103-ae12-0c08fdb61c75#F7", "claim": "\u2026pg_cancel_backend() cancels the query\u2026", "title": "pg_cancel_backend requests current-query cancellation", "explanation": "pg_cancel_backend sends SIGINT to cancel the target backend's current query. It preserves the database session. The article correctly distinguishes this operation from pg_terminate_backend.", "verdict": "Accurate", "sources": [{"url": "https://github.com/postgres/postgres/blob/083ac033419f690758508e08c1736089384bbee8/doc/src/sgml/func.sgml#L28178-L28179", "label": "REL_17_11 \u00b7 doc/src/sgml/func.sgml:28178-28179"}, {"url": "https://github.com/postgres/postgres/blob/083ac033419f690758508e08c1736089384bbee8/src/backend/storage/ipc/signalfuncs.c#L124-L124", "label": "REL_17_11 \u00b7 src/backend/storage/ipc/signalfuncs.c:124-124"}]}, {"anchor": "F8", "url": "https://pgtrue.postgres.ai/shared/brief/ea1fd3f3-90d2-4103-ae12-0c08fdb61c75#F8", "claim": "\u2026pg_terminate_backend() ends the entire database session\u2026", "explanation": "pg_terminate_backend sends SIGTERM to the target backend (E-30). PostgreSQL describes the function as terminating the session identified by its process ID (E-29).", "verdict": "Accurate", "sources": [{"url": "https://github.com/postgres/postgres/blob/083ac033419f690758508e08c1736089384bbee8/doc/src/sgml/func.sgml#L28252-L28253", "label": "REL_17_11 \u00b7 doc/src/sgml/func.sgml:28252-28253"}, {"url": "https://github.com/postgres/postgres/blob/083ac033419f690758508e08c1736089384bbee8/src/backend/storage/ipc/signalfuncs.c#L230-L230", "label": "REL_17_11 \u00b7 src/backend/storage/ipc/signalfuncs.c:230-230"}]}, {"anchor": "F9", "url": "https://pgtrue.postgres.ai/shared/brief/ea1fd3f3-90d2-4103-ae12-0c08fdb61c75#F9", "claim": "\u2026terminates sessions that remain idle within an open transaction\u2026", "title": "idle_in_transaction_session_timeout terminates idle transactional sessions", "explanation": "idle_in_transaction_session_timeout limits idle time while an open transaction waits for client input. Expiration terminates the session. This check does not establish Aurora's default parameter value.", "verdict": "Accurate", "sources": [{"url": "https://github.com/postgres/postgres/blob/083ac033419f690758508e08c1736089384bbee8/doc/src/sgml/config.sgml#L9574-L9576", "label": "REL_17_11 \u00b7 doc/src/sgml/config.sgml:9574-9576"}, {"url": "https://github.com/postgres/postgres/blob/083ac033419f690758508e08c1736089384bbee8/src/backend/utils/misc/guc_tables.c#L2635-L2635", "label": "REL_17_11 \u00b7 src/backend/utils/misc/guc_tables.c:2635-2635"}]}, {"anchor": "F10", "url": "https://pgtrue.postgres.ai/shared/brief/ea1fd3f3-90d2-4103-ae12-0c08fdb61c75#F10", "claim": "\u2026maximum execution time for individual SQL statements\u2026", "explanation": "statement_timeout aborts a statement that exceeds the specified duration (E-33). Its configuration definition identifies the limit as the maximum allowed duration of any statement (E-34).", "verdict": "Accurate", "sources": [{"url": "https://github.com/postgres/postgres/blob/083ac033419f690758508e08c1736089384bbee8/doc/src/sgml/config.sgml#L9465-L9465", "label": "REL_17_11 \u00b7 doc/src/sgml/config.sgml:9465-9465"}, {"url": "https://github.com/postgres/postgres/blob/083ac033419f690758508e08c1736089384bbee8/src/backend/utils/misc/guc_tables.c#L2613-L2613", "label": "REL_17_11 \u00b7 src/backend/utils/misc/guc_tables.c:2613-2613"}]}, {"anchor": "F11", "url": "https://pgtrue.postgres.ai/shared/brief/ea1fd3f3-90d2-4103-ae12-0c08fdb61c75#F11", "claim": "\u2026covering both explicit and implicit transactions\u2026", "title": "transaction_timeout covers explicit and implicit transactions in PostgreSQL 17", "explanation": "transaction_timeout terminates sessions whose transactions exceed the limit. It covers BEGIN transactions and implicit single-statement transactions. We confirmed the behavior in PostgreSQL 17.0 and 17.11. Prepared transactions are excluded.", "verdict": "Accurate", "sources": [{"url": "https://github.com/postgres/postgres/blob/083ac033419f690758508e08c1736089384bbee8/doc/src/sgml/config.sgml#L9501-L9504", "label": "REL_17_11 \u00b7 doc/src/sgml/config.sgml:9501-9504"}, {"url": "https://github.com/postgres/postgres/blob/083ac033419f690758508e08c1736089384bbee8/src/backend/utils/misc/guc_tables.c#L2646-L2646", "label": "REL_17_11 \u00b7 src/backend/utils/misc/guc_tables.c:2646-2646"}, {"url": "https://github.com/postgres/postgres/blob/d7ec59a63d745ba74fba0e280bbf85dc6d1caa3e/doc/src/sgml/config.sgml#L9376-L9379", "label": "REL_17_0 \u00b7 doc/src/sgml/config.sgml:9376-9379"}]}, {"anchor": "F12", "url": "https://pgtrue.postgres.ai/shared/brief/ea1fd3f3-90d2-4103-ae12-0c08fdb61c75#F12", "claim": "\u2026how long a session waits to acquire a lock before failing\u2026", "title": "lock_timeout limits individual lock acquisition waits", "explanation": "lock_timeout aborts a statement when a lock acquisition wait exceeds the limit. PostgreSQL applies it separately to each acquisition attempt. It does not limit the duration of an already-held lock.", "verdict": "Accurate", "sources": [{"url": "https://github.com/postgres/postgres/blob/083ac033419f690758508e08c1736089384bbee8/doc/src/sgml/config.sgml#L9539-L9540", "label": "REL_17_11 \u00b7 doc/src/sgml/config.sgml:9539-9540"}, {"url": "https://github.com/postgres/postgres/blob/083ac033419f690758508e08c1736089384bbee8/src/backend/utils/misc/guc_tables.c#L2624-L2624", "label": "REL_17_11 \u00b7 src/backend/utils/misc/guc_tables.c:2624-2624"}]}, {"anchor": "F13", "url": "https://pgtrue.postgres.ai/shared/brief/ea1fd3f3-90d2-4103-ae12-0c08fdb61c75#F13", "claim": "\u2026pgrowlocks extension performs full table scans\u2026", "title": "pgrowlocks scans the target table", "explanation": "pgrowlocks reads target-table rows individually to collect tuple-lock information. Its unrestricted scan supports the article's warning about production overhead on large tables.", "verdict": "Accurate", "sources": [{"url": "https://github.com/postgres/postgres/blob/083ac033419f690758508e08c1736089384bbee8/doc/src/sgml/pgrowlocks.sgml#L93-L95", "label": "REL_17_11 \u00b7 doc/src/sgml/pgrowlocks.sgml:93-95"}, {"url": "https://github.com/postgres/postgres/blob/083ac033419f690758508e08c1736089384bbee8/contrib/pgrowlocks/pgrowlocks.c#L114-L114", "label": "REL_17_11 \u00b7 contrib/pgrowlocks/pgrowlocks.c:114-114"}]}, {"anchor": "F14", "url": "https://pgtrue.postgres.ai/shared/brief/ea1fd3f3-90d2-4103-ae12-0c08fdb61c75#F14", "claim": "NOWAIT and SKIP LOCKED are mutually exclusive modifiers on the same locking clause\u2026", "explanation": "Each locking clause chooses NOWAIT or SKIP LOCKED (E-42). NOWAIT reports an error when a selected row cannot be locked immediately. SKIP LOCKED skips that row (E-43). SQLSTATE 55P03 identifies lock_not_available (E-45).", "verdict": "Accurate", "sources": [{"url": "https://github.com/postgres/postgres/blob/083ac033419f690758508e08c1736089384bbee8/doc/src/sgml/ref/select.sgml#L48-L48", "label": "REL_17_11 \u00b7 doc/src/sgml/ref/select.sgml:48-48"}, {"url": "https://github.com/postgres/postgres/blob/083ac033419f690758508e08c1736089384bbee8/doc/src/sgml/ref/select.sgml#L1602-L1607", "label": "REL_17_11 \u00b7 doc/src/sgml/ref/select.sgml:1602-1607"}, {"url": "https://github.com/postgres/postgres/blob/083ac033419f690758508e08c1736089384bbee8/src/backend/executor/nodeLockRows.c#L193-L195", "label": "REL_17_11 \u00b7 src/backend/executor/nodeLockRows.c:193-195"}, {"url": "https://github.com/postgres/postgres/blob/083ac033419f690758508e08c1736089384bbee8/src/backend/utils/errcodes.txt#L421-L421", "label": "REL_17_11 \u00b7 src/backend/utils/errcodes.txt:421-421"}]}, {"anchor": "F17", "url": "https://pgtrue.postgres.ai/shared/brief/ea1fd3f3-90d2-4103-ae12-0c08fdb61c75#F17", "claim": "transaction_timeout (PostgreSQL 17+)\u2026", "title": "transaction_timeout exists at the stated PostgreSQL 17 floor", "explanation": "PostgreSQL 17.0 and 17.11 register transaction_timeout in src/backend/utils/misc/guc_tables.c:2635 and 2645, respectively. The article's PostgreSQL 17 version floor holds.", "verdict": "Accurate", "sources": [{"url": "https://github.com/postgres/postgres/blob/d7ec59a63d745ba74fba0e280bbf85dc6d1caa3e/src/backend/utils/misc/guc_tables.c#L2634-L2644", "label": "REL_17_0 \u00b7 src/backend/utils/misc/guc_tables.c:2634-2644"}, {"url": "https://github.com/postgres/postgres/blob/083ac033419f690758508e08c1736089384bbee8/src/backend/utils/misc/guc_tables.c#L2644-L2654", "label": "REL_17_11 \u00b7 src/backend/utils/misc/guc_tables.c:2644-2654"}]}, {"anchor": "F18", "url": "https://pgtrue.postgres.ai/shared/brief/ea1fd3f3-90d2-4103-ae12-0c08fdb61c75#F18", "claim": "\u2026you need to enable Advanced mode in Database Insights\u2026", "title": "Lock Analysis requires Database Insights Advanced mode", "explanation": "AWS documents Advanced mode as a prerequisite for analyzing lock trees. The article correctly states that requirement for Lock Analysis.", "verdict": "Accurate", "sources": [{"url": "https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Database-Insights-Lock-Analysis.html", "label": "https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Database-Insights-Lock-Analysis.html"}]}, {"anchor": "F19", "url": "https://pgtrue.postgres.ai/shared/brief/ea1fd3f3-90d2-4103-ae12-0c08fdb61c75#F19", "claim": "It applies separately to each statement in multi-statement transactions\u2026", "title": "statement_timeout applies separately to individual statements", "explanation": "PostgreSQL 17.11 documents separate statement limits in doc/src/sgml/config.sgml:9474\u20139477. statement_timeout does not impose one cumulative limit on a multistatement transaction.", "verdict": "Accurate", "sources": [{"url": "https://github.com/postgres/postgres/blob/083ac033419f690758508e08c1736089384bbee8/doc/src/sgml/config.sgml#L9474-L9477", "label": "REL_17_11 \u00b7 doc/src/sgml/config.sgml:9474-9477"}]}, {"anchor": "F20", "url": "https://pgtrue.postgres.ai/shared/brief/ea1fd3f3-90d2-4103-ae12-0c08fdb61c75#F20", "claim": "\u20263,944,045, or approximately 31 percent of items processed\u2026", "title": "The retry ratio rounds to 31%", "explanation": "The summary gives 30.8 retry attempts per 100 processed items (derived: 3,944,045 / 12,799,175 \u00d7 100). The article correctly rounds this ratio to 31%. Multiple retries can belong to one item.", "verdict": "Accurate", "sources": []}, {"anchor": "F21", "url": "https://pgtrue.postgres.ai/shared/brief/ea1fd3f3-90d2-4103-ae12-0c08fdb61c75#F21", "claim": "\u2026about 0.024% of orders failed\u2026", "explanation": "The displayed counts yield 0.0238 failures per 100 processed items (derived: 3,040 / 12,799,175 \u00d7 100). This rounds to 0.024% (E-61, E-63). E-64 describes single-item orders but does not define the displayed counters. The calculation alone does not verify an order-failure rate.", "verdict": "Accurate", "sources": [{"url": "https://aws.amazon.com/blogs/database/troubleshooting-row-lock-contention-in-amazon-aurora-postgresql-part-1-understanding-row-lock-contention-in-postgresql/", "label": "https://aws.amazon.com/blogs/database/troubleshooting-row-lock-contention-in-amazon-aurora-postgresql-part-1-understanding-row-lock-contention-in-postgresql/"}]}, {"anchor": "F22", "url": "https://pgtrue.postgres.ai/shared/brief/ea1fd3f3-90d2-4103-ae12-0c08fdb61c75#F22", "claim": "\u202655 perccent throughput reduction\u2026", "title": "The reported throughput values imply a 55% reduction", "explanation": "The reported throughput falls 55.0% from 10,900 TPS to 4,900 TPS (derived: (10,900 \u2212 4,900) / 10,900 \u00d7 100). The arithmetic holds. These values alone do not isolate contention from the changed workload.", "verdict": "Accurate", "sources": []}]}