Limited beta · What is this?

pgTrue is under active development: reports may contain significant mistakes, inaccuracies, or bugs. Please report anything you find to pgtrue@postgres.ai.

pgTrue is an independent fact-check of technical Postgres articles. Read the questions and answers.

pgTrue fact-check

ElephantSeal ALimited coverage

Embed

The ElephantSeal always shows this report's latest edition and links here. Copies cached elsewhere may update later.

[![pgTrue fact-check](https://pgtrue.postgres.ai/badge/f01d0141-796c-4a87-a3bf-3ec19aa9cc7d.svg?v=13&theme=light)](https://pgtrue.postgres.ai/shared/brief/f01d0141-796c-4a87-a3bf-3ec19aa9cc7d)
<a href="https://pgtrue.postgres.ai/shared/brief/f01d0141-796c-4a87-a3bf-3ec19aa9cc7d"><img src="https://pgtrue.postgres.ai/badge/f01d0141-796c-4a87-a3bf-3ec19aa9cc7d.svg?v=13&amp;theme=light" alt="pgTrue fact-check" width="90" height="20" loading="lazy" decoding="async" style="display:inline-block;width:90px;height:20px"></a>
https://pgtrue.postgres.ai/badge/f01d0141-796c-4a87-a3bf-3ec19aa9cc7d.svg?v=13&theme=light
.. image:: https://pgtrue.postgres.ai/badge/f01d0141-796c-4a87-a3bf-3ec19aa9cc7d.svg?v=13&theme=light
   :target: https://pgtrue.postgres.ai/shared/brief/f01d0141-796c-4a87-a3bf-3ec19aa9cc7d
   :alt: pgTrue fact-check
   :width: 90
   :height: 20
[![pgTrue fact-check](https://pgtrue.postgres.ai/badge/f01d0141-796c-4a87-a3bf-3ec19aa9cc7d.svg?v=13&theme=dark)](https://pgtrue.postgres.ai/shared/brief/f01d0141-796c-4a87-a3bf-3ec19aa9cc7d)
<a href="https://pgtrue.postgres.ai/shared/brief/f01d0141-796c-4a87-a3bf-3ec19aa9cc7d"><img src="https://pgtrue.postgres.ai/badge/f01d0141-796c-4a87-a3bf-3ec19aa9cc7d.svg?v=13&amp;theme=dark" alt="pgTrue fact-check" width="90" height="20" loading="lazy" decoding="async" style="display:inline-block;width:90px;height:20px"></a>
https://pgtrue.postgres.ai/badge/f01d0141-796c-4a87-a3bf-3ec19aa9cc7d.svg?v=13&theme=dark
.. image:: https://pgtrue.postgres.ai/badge/f01d0141-796c-4a87-a3bf-3ec19aa9cc7d.svg?v=13&theme=dark
   :target: https://pgtrue.postgres.ai/shared/brief/f01d0141-796c-4a87-a3bf-3ec19aa9cc7d
   :alt: pgTrue fact-check
   :width: 90
   :height: 20
[![pgTrue fact-check](https://pgtrue.postgres.ai/badge/f01d0141-796c-4a87-a3bf-3ec19aa9cc7d.svg?v=13)](https://pgtrue.postgres.ai/shared/brief/f01d0141-796c-4a87-a3bf-3ec19aa9cc7d)
<a href="https://pgtrue.postgres.ai/shared/brief/f01d0141-796c-4a87-a3bf-3ec19aa9cc7d"><img src="https://pgtrue.postgres.ai/badge/f01d0141-796c-4a87-a3bf-3ec19aa9cc7d.svg?v=13" alt="pgTrue fact-check" width="90" height="20" loading="lazy" decoding="async" style="display:inline-block;width:90px;height:20px"></a>
https://pgtrue.postgres.ai/badge/f01d0141-796c-4a87-a3bf-3ec19aa9cc7d.svg?v=13
.. image:: https://pgtrue.postgres.ai/badge/f01d0141-796c-4a87-a3bf-3ec19aa9cc7d.svg?v=13
   :target: https://pgtrue.postgres.ai/shared/brief/f01d0141-796c-4a87-a3bf-3ec19aa9cc7d
   :alt: pgTrue fact-check
   :width: 90
   :height: 20
[![pgTrue fact-check](https://pgtrue.postgres.ai/badge/f01d0141-796c-4a87-a3bf-3ec19aa9cc7d/radar.svg?v=13&theme=light)](https://pgtrue.postgres.ai/shared/brief/f01d0141-796c-4a87-a3bf-3ec19aa9cc7d)
<a href="https://pgtrue.postgres.ai/shared/brief/f01d0141-796c-4a87-a3bf-3ec19aa9cc7d"><img src="https://pgtrue.postgres.ai/badge/f01d0141-796c-4a87-a3bf-3ec19aa9cc7d/radar.svg?v=13&amp;theme=light" alt="pgTrue fact-check" width="240" height="240" loading="lazy" decoding="async" style="display:inline-block;width:240px;height:240px"></a>
https://pgtrue.postgres.ai/badge/f01d0141-796c-4a87-a3bf-3ec19aa9cc7d/radar.svg?v=13&theme=light
.. image:: https://pgtrue.postgres.ai/badge/f01d0141-796c-4a87-a3bf-3ec19aa9cc7d/radar.svg?v=13&theme=light
   :target: https://pgtrue.postgres.ai/shared/brief/f01d0141-796c-4a87-a3bf-3ec19aa9cc7d
   :alt: pgTrue fact-check
   :width: 240
   :height: 240
[![pgTrue fact-check](https://pgtrue.postgres.ai/badge/f01d0141-796c-4a87-a3bf-3ec19aa9cc7d/radar.svg?v=13&theme=dark)](https://pgtrue.postgres.ai/shared/brief/f01d0141-796c-4a87-a3bf-3ec19aa9cc7d)
<a href="https://pgtrue.postgres.ai/shared/brief/f01d0141-796c-4a87-a3bf-3ec19aa9cc7d"><img src="https://pgtrue.postgres.ai/badge/f01d0141-796c-4a87-a3bf-3ec19aa9cc7d/radar.svg?v=13&amp;theme=dark" alt="pgTrue fact-check" width="240" height="240" loading="lazy" decoding="async" style="display:inline-block;width:240px;height:240px"></a>
https://pgtrue.postgres.ai/badge/f01d0141-796c-4a87-a3bf-3ec19aa9cc7d/radar.svg?v=13&theme=dark
.. image:: https://pgtrue.postgres.ai/badge/f01d0141-796c-4a87-a3bf-3ec19aa9cc7d/radar.svg?v=13&theme=dark
   :target: https://pgtrue.postgres.ai/shared/brief/f01d0141-796c-4a87-a3bf-3ec19aa9cc7d
   :alt: pgTrue fact-check
   :width: 240
   :height: 240
[![pgTrue fact-check](https://pgtrue.postgres.ai/badge/f01d0141-796c-4a87-a3bf-3ec19aa9cc7d/radar.svg?v=13)](https://pgtrue.postgres.ai/shared/brief/f01d0141-796c-4a87-a3bf-3ec19aa9cc7d)
<a href="https://pgtrue.postgres.ai/shared/brief/f01d0141-796c-4a87-a3bf-3ec19aa9cc7d"><img src="https://pgtrue.postgres.ai/badge/f01d0141-796c-4a87-a3bf-3ec19aa9cc7d/radar.svg?v=13" alt="pgTrue fact-check" width="240" height="240" loading="lazy" decoding="async" style="display:inline-block;width:240px;height:240px"></a>
https://pgtrue.postgres.ai/badge/f01d0141-796c-4a87-a3bf-3ec19aa9cc7d/radar.svg?v=13
.. image:: https://pgtrue.postgres.ai/badge/f01d0141-796c-4a87-a3bf-3ec19aa9cc7d/radar.svg?v=13
   :target: https://pgtrue.postgres.ai/shared/brief/f01d0141-796c-4a87-a3bf-3ec19aa9cc7d
   :alt: pgTrue fact-check
   :width: 240
   :height: 240
[![pgTrue fact-check](https://pgtrue.postgres.ai/badge/f01d0141-796c-4a87-a3bf-3ec19aa9cc7d/wide.svg?v=13&theme=light)](https://pgtrue.postgres.ai/shared/brief/f01d0141-796c-4a87-a3bf-3ec19aa9cc7d)
<a href="https://pgtrue.postgres.ai/shared/brief/f01d0141-796c-4a87-a3bf-3ec19aa9cc7d"><img src="https://pgtrue.postgres.ai/badge/f01d0141-796c-4a87-a3bf-3ec19aa9cc7d/wide.svg?v=13&amp;theme=light" alt="pgTrue fact-check" width="480" height="240" loading="lazy" decoding="async" style="display:inline-block;width:480px;height:240px"></a>
https://pgtrue.postgres.ai/badge/f01d0141-796c-4a87-a3bf-3ec19aa9cc7d/wide.svg?v=13&theme=light
.. image:: https://pgtrue.postgres.ai/badge/f01d0141-796c-4a87-a3bf-3ec19aa9cc7d/wide.svg?v=13&theme=light
   :target: https://pgtrue.postgres.ai/shared/brief/f01d0141-796c-4a87-a3bf-3ec19aa9cc7d
   :alt: pgTrue fact-check
   :width: 480
   :height: 240
[![pgTrue fact-check](https://pgtrue.postgres.ai/badge/f01d0141-796c-4a87-a3bf-3ec19aa9cc7d/wide.svg?v=13&theme=dark)](https://pgtrue.postgres.ai/shared/brief/f01d0141-796c-4a87-a3bf-3ec19aa9cc7d)
<a href="https://pgtrue.postgres.ai/shared/brief/f01d0141-796c-4a87-a3bf-3ec19aa9cc7d"><img src="https://pgtrue.postgres.ai/badge/f01d0141-796c-4a87-a3bf-3ec19aa9cc7d/wide.svg?v=13&amp;theme=dark" alt="pgTrue fact-check" width="480" height="240" loading="lazy" decoding="async" style="display:inline-block;width:480px;height:240px"></a>
https://pgtrue.postgres.ai/badge/f01d0141-796c-4a87-a3bf-3ec19aa9cc7d/wide.svg?v=13&theme=dark
.. image:: https://pgtrue.postgres.ai/badge/f01d0141-796c-4a87-a3bf-3ec19aa9cc7d/wide.svg?v=13&theme=dark
   :target: https://pgtrue.postgres.ai/shared/brief/f01d0141-796c-4a87-a3bf-3ec19aa9cc7d
   :alt: pgTrue fact-check
   :width: 480
   :height: 240
[![pgTrue fact-check](https://pgtrue.postgres.ai/badge/f01d0141-796c-4a87-a3bf-3ec19aa9cc7d/wide.svg?v=13)](https://pgtrue.postgres.ai/shared/brief/f01d0141-796c-4a87-a3bf-3ec19aa9cc7d)
<a href="https://pgtrue.postgres.ai/shared/brief/f01d0141-796c-4a87-a3bf-3ec19aa9cc7d"><img src="https://pgtrue.postgres.ai/badge/f01d0141-796c-4a87-a3bf-3ec19aa9cc7d/wide.svg?v=13" alt="pgTrue fact-check" width="480" height="240" loading="lazy" decoding="async" style="display:inline-block;width:480px;height:240px"></a>
https://pgtrue.postgres.ai/badge/f01d0141-796c-4a87-a3bf-3ec19aa9cc7d/wide.svg?v=13
.. image:: https://pgtrue.postgres.ai/badge/f01d0141-796c-4a87-a3bf-3ec19aa9cc7d/wide.svg?v=13
   :target: https://pgtrue.postgres.ai/shared/brief/f01d0141-796c-4a87-a3bf-3ec19aa9cc7d
   :alt: pgTrue fact-check
   :width: 480
   :height: 240

Click the snippet to select all of it, then copy. Where SVG is stripped, as in some email clients and feed readers, change .svg to .png. PNG uses the light theme for Auto. For Markdown PNG embeds, use the HTML snippet where supported to preserve the display size.

Optional colours: append &color=26798E or &labelColor=333C47 after a theme query (use ? for the first parameter). Use 3- or 6-digit hex.

For pages with a light background.

For pages with a dark background. The ElephantSeal gets a thin edge so it does not blend in.

Auto follows the reader's light or dark setting where the host supports it, and shows the light ElephantSeal where it does not.

On a light page
On a dark page

Troubleshooting row lock contention in Amazon Aurora PostgreSQL: Part 1 – Understanding row lock contention in PostgreSQL | Amazon Web Services (opens in new tab)

aws.amazon.com
Sound as far as we checked.
0
inaccuracy
0
dangerous-recipe
0
misleading
0
imprecise
0
transcription
0
aged
0
withdrawn
12
verified-accurate

Factual A · Applicable A · Consistent A · Transparent — · Safe —

ReportTechnical fact-check, edition 3 pgTrue versionaudited with v1.0.17 (approx.) · regraded with v1.1.3 Issued EditionUpdated after review. Corrections are listed below. SubmittedSubmitted by the PostgresAI team. Author responseNo written reply from the author. We re-audited this article 5 times; see Revisions below. Policy: right-of-reply and corrections policy.

InaccuraciesNone in this edition.

Dangerous or recipe bugsNone in this edition.

Misleading / impreciseNone in this edition.

Verified accurate

F2

Session activity and blocker discovery support the monitoring query

ACCURATEFactual · holds up after review

Claim ledger

Article says
…view combined with the pg_blocking_pids() function shows lock relationships between sessions…
What is true
pg_stat_activity supplies the selected session fields. pg_blocking_pids() identifies incompatible lock holders and conflicting waiters ahead in the queue. system_views.sql:894-900 defines the activity fields. lockfuncs.c:553-554 emits blocking process IDs.
Charitable reading
The article uses the function for lock relationships, not arbitrary waits such as buffer pins.

Source

Source · REL_18_6 · doc/src/sgml/func.sgml:25002-25005One server process blocks another if it either holds a lock that conflicts with the blocked process's lock request (hard block), or is waiting for a lock that would conflict with the blocked process's lock request and is ahead of it in the wait queue (soft block). When using
In the article · section “Monitoring locks using system views and functions”

In the article

excerpt · section “Monitoring locks using system views and functions” · as fetched 2026-10-21 · open in article ↗ (opens in new tab)

Monitoring locks using system views and functions

PostgreSQL provides system views and functions to identify blocking sessions. The pg_stat_activity view combined with the pg_blocking_pids() function shows lock relationships between sessions. The following query returns the blocking process ID ( pid ) and details of the blocked process:

testdb=> select pid, pg_blocking_pids(pid) as blockers, wait_event_type, wait_event, state, backend_xid, query
from pg_stat_activity
where pid in (1943, 2053);

 pid  | blockers | wait_event_type |  wait_event   |        state        | backend_xid |                  query
------+----------+-----------------+---------------+---------------------+-------------+------------------------------------------
 1943 | {}       | Client          | ClientRead    | idle in transaction |     3194633 | select pg_backend_pid(), txid_current();
 2053 | {1943}   | Lock            | transactionid | active              |     3194801 | update my_tab
      |          |                 |               |                     |             | set val = -100
      |          |                 |               |                     |             | where id = 888;
All sources and excerpts · 3
Evidence One server process blocks another if it either holds a lock that conflicts with the blocked process's lock request (hard block), or is waiting for a lock that would conflict with the blocked process's lock request and is ahead of it in the wait queue (soft block). When using
Evidence S.wait_event_type, S.wait_event, S.state, S.backend_xid, s.backend_xmin, S.query_id, S.query,
Evidence /* blocked by this entry, so emit a record */ arrayelems[narrayelems++] = Int32GetDatum(instance->leaderPid);
How the review tested this

Review: We tested whether the finding overlooks queued blockers. E-12 explicitly includes hard and soft blocking. The selected activity fields match E-13. We tested whether blocker discovery excludes queued blockers. E-12 explicitly includes conflicting waiters ahead in the queue. The selected activity fields and emitted blocker identifiers match the finding.

F3

The transaction-ID query does not enumerate tuple-header locks

ACCURATEFactual · holds up after review

Claim ledger

Article says
…not the individual row locks stored in data pages…
What is true
pg_locks normally represents a row-lock wait through the holder's transaction ID. It does not enumerate every locked tuple. system-views.sgml:1916-1921 documents this distinction. The article's transaction-ID filter matches that behavior.
Charitable reading
The sentence describes tuple-header locks and the transaction-ID-filtered example. It does not deny heavyweight tuple locks exist.

Source

Source · REL_18_6 · doc/src/sgml/system-views.sgml:1916-1921Although tuples are a lockable type of object, information about row-level locks is stored on disk, not in memory, and therefore row-level locks normally do not appear in this view. If a process is waiting for a row-level lock, it will usually appear in the view as waiting for the permanent transaction ID of the current holder of that row lock.
In the article · section “Monitoring locks using system views and functions”

In the article

excerpt · section “Monitoring locks using system views and functions” · as fetched 2026-10-21 · open in article ↗ (opens in new tab)

Monitoring locks using system views and functions

The backend process 1943 holds the transactionid lock ( granted = true ), while process 2053 waits to acquire it ( granted = false ). The pg_locks view shows only the transactionid lock in shared memory, not the individual row locks stored in data pages.

All sources and excerpts · 2
Evidence Although tuples are a lockable type of object, information about row-level locks is stored on disk, not in memory, and therefore row-level locks normally do not appear in this view. If a process is waiting for a row-level lock, it will usually appear in the view as waiting for the permanent transaction ID of the current holder of that row lock.
EvidenceCREATE VIEW pg_locks AS SELECT * FROM pg_lock_status() AS L;
How the review tested this

Review: We tested whether heavyweight tuple locks contradict the finding. Its distinction concerns tuple-header ownership and the transaction-ID-filtered query. E-15 supports that distinction. We tested whether heavyweight tuple entries contradict this finding. E-15 distinguishes stored row locks from transaction-ID waits. The article's filtered query supports the narrower interpretation.

F4

The identifier query returns the current backend and transaction

ACCURATEFactual · holds up after review

Claim ledger

Article says
…SELECT pg_backend_pid(), txid_current();…
What is true
pg_backend_pid() returns MyProcPid in pgstatfuncs.c:692. txid_current() returns the current top-level transaction ID. It assigns an ID when necessary. The article uses both functions consistently with their documented meanings.
Charitable reading
The displayed identifiers are examples, not values another installation must return.

Source

Source · REL_18_6 · src/backend/utils/adt/pgstatfuncs.c:689-693Datum pg_backend_pid(PG_FUNCTION_ARGS) { PG_RETURN_INT32(MyProcPid); }
In the article · section “Example of row locks”

In the article

excerpt · section “Example of row locks” · as fetched 2026-10-21 · open in article ↗ (opens in new tab)

Example of row locks

testdb=> SELECT pg_backend_pid(), txid_current();

 pg_backend_pid | txid_current
----------------+--------------
           1943 |      3194633
testdb=> BEGIN;
BEGIN

testdb=> SELECT pg_backend_pid(), txid_current();

 pg_backend_pid | txid_current
----------------+--------------
           2053 |      3194801

testdb=> UPDATE my_tab
SET val = -100
WHERE id = 888;

<hangs>
All sources and excerpts · 3
EvidenceDatum pg_backend_pid(PG_FUNCTION_ARGS) { PG_RETURN_INT32(MyProcPid); }
Evidence <function>txid_current</function> () <returnvalue>bigint</returnvalue> </para> <para> See <function>pg_current_xact_id()</function>.
Evidence Returns the current transaction's ID. It will assign a new one if the current transaction does not have one already (because it has not performed any database updates); see <xref linkend="transaction-id"/> for details. If executed in a subtransaction, this will return the top-level transaction ID;
How the review tested this

Review: We checked ID assignment and subtransaction semantics. E-18 links txid_current() to the behavior documented in E-19. The finding does not authenticate displayed identifiers. We checked transaction-ID assignment and subtransaction behavior. E-18 connects txid_current() to the documented current-ID function. E-19 confirms assignment and top-level transaction semantics. The finding does not authenticate example identifiers.

F5

Enabled lock-wait logging uses the deadlock timeout

ACCURATEFactual · holds up after review

Claim ledger

Article says
…logs lock wait events that exceed deadlock_timeout (default 1 second)…
What is true
log_lock_waits reports waits after deadlock_timeout. The default delay is 1,000 milliseconds in guc_tables.c:2266-2274. proc.c:1592 gates reporting on enabled logging and the deadlock check. proc.c:1653-1656 also logs eventual acquisition.
Charitable reading
The article explicitly conditions its example on enabled lock-wait logging.

Source

Source · REL_18_6 · doc/src/sgml/config.sgml:8041-8044Controls whether a log message is produced when a session waits longer than <xref linkend="guc-deadlock-timeout"/> to acquire a lock. This is useful in determining if lock waits are causing poor performance. The default is <literal>off</literal>.
In the article · section “Logging using the log_lock_waits parameter”

In the article

excerpt · section “Logging using the log_lock_waits parameter” · as fetched 2026-10-21 · open in article ↗ (opens in new tab)

Logging using the log_lock_waits parameter

The log_lock_waits parameter logs lock wait events that exceed deadlock_timeout (default 1 second) in the database log. The following is an example log excerpt when lock wait logging is enabled:

LOG: process 2053 still waiting for ShareLock on transaction 3194633 after 1000.086 ms
DETAIL: Process holding the lock: 1943. Wait queue: 2053.
CONTEXT: while updating tuple (3,210) in relation "my_tab"
STATEMENT: update my_tab
set val = -100
where id = 888;
All sources and excerpts · 4
Evidence Controls whether a log message is produced when a session waits longer than <xref linkend="guc-deadlock-timeout"/> to acquire a lock. This is useful in determining if lock waits are causing poor performance. The default is <literal>off</literal>.
Evidence {"deadlock_timeout", PGC_SUSET, LOCK_MANAGEMENT, gettext_noop("Sets the time to wait on a lock before checking for deadlock."), NULL, GUC_UNIT_MS }, &DeadlockTimeout, 1000, 1, INT_MAX, NULL, NULL, NULL },
Evidence /* * If awoken after the deadlock check interrupt has run, and * log_lock_waits is on, then report about the wait. */ if (log_lock_waits && deadlock_state != DS_NOT_YET_CHECKED)
Evidence else if (myWaitStatus == PROC_WAIT_STATUS_OK) ereport(LOG, (errmsg("process %d acquired %s on %s after %ld.%03d ms", MyProcPid, modename, buf.data, msecs, usecs)));
How the review tested this

Review: We tested the disabled-by-default objection. The article and finding condition reporting on enabled log_lock_waits. E-22 confirms the reporting gate. We checked whether disabled logging defeats the claim. Both the finding and surrounding article condition the example on enabled logging. The source confirms the threshold, default, and acquisition message.

F6

pgrowlocks scans the table to inspect row locks

ACCURATEFactual · holds up after review · also flagged 1 more time

Claim ledger

Article says
…pgrowlocks performs a full table scan…
What is true
pgrowlocks reads rows sequentially to collect lock information. pgrowlocks.c:116-124 starts the scan and repeatedly fetches tuples. pgrowlocks.sgml:93-95 warns about large-table cost. The article correctly warns against unrestricted production scans.
Charitable reading
Avoiding production use is conservative operational advice, not a claim that PostgreSQL forbids it.

Source

Source · REL_18_6 · doc/src/sgml/pgrowlocks.sgml:93-95<function>pgrowlocks</function> takes <literal>AccessShareLock</literal> for the target table and reads each row one by one to collect the row locking information. This is not very speedy for a large table. Note that:
In the article · section “Examining row locks using the pgrowlocks extension”

In the article

excerpt · section “Examining row locks using the pgrowlocks extension” · as fetched 2026-10-21 · open in article ↗ (opens in new tab)

Examining row locks using the pgrowlocks extension

Note : pgrowlocks performs a full table scan and may impact database performance. You can use the pgrowlocks extension in a test environment while analyzing row lock contention, but avoid using it in production environments.

All sources and excerpts · 2
Evidence <function>pgrowlocks</function> takes <literal>AccessShareLock</literal> for the target table and reads each row one by one to collect the row locking information. This is not very speedy for a large table. Note that:
Evidence /* Scan the relation */ scan = table_beginscan(rel, GetActiveSnapshot(), 0, NULL); hscan = (HeapScanDesc) scan; attinmeta = TupleDescGetAttInMetadata(rsinfo->setDesc); values = (char **) palloc(rsinfo->setDesc->natts * sizeof(char *)); while ((tuple = heap_getnext(scan, ForwardScanDirection)) != NULL)
How the review tested this

Review: We checked whether pgrowlocks restricts its scan to locked rows. E-25 starts an unrestricted scan. The finding treats production avoidance as operational advice. We tested whether the scan uses filtering or guarantees production disruption. E-25 shows an unrestricted scan and tuple loop. E-24 warns about large-table cost. The finding treats production avoidance as conservative advice.

F7

Verified accurate: “FOR UPDATE serves as the most restrictive mode…”

ACCURATEFactual · partly holds after review

Claim ledger

Article says
FOR UPDATE serves as the most restrictive mode…
What is true
FOR UPDATE conflicts with all four row-lock modes. FOR NO KEY UPDATE permits FOR KEY SHARE. REL_18_6 src/backend/access/heap/README.tuplock:65-69 gives this conflict table. This verifies the mode ordering, not the displayed UPDATE execution.

Source

Source · REL_18_6 · src/backend/access/heap/README.tuplock:65-69 UPDATE NO KEY UPDATE SHARE KEY SHARE UPDATE conflict conflict conflict conflict NO KEY UPDATE conflict conflict conflict SHARE conflict conflict KEY SHARE conflict
In the article · section “How locks work in PostgreSQL”

In the article

excerpt · section “How locks work in PostgreSQL” · as fetched 2026-10-21 · open in article ↗ (opens in new tab)

How locks work in PostgreSQL

PostgreSQL provides several row lock modes with different restriction levels. FOR UPDATE serves as the most restrictive mode, while FOR NO KEY UPDATE permits more concurrent operations. The FOR SHARE and FOR KEY SHARE modes allow concurrent readers while blocking specific write operations.

All sources and excerpts · 1
Evidence UPDATE NO KEY UPDATE SHARE KEY SHARE UPDATE conflict conflict conflict conflict NO KEY UPDATE conflict conflict conflict SHARE conflict conflict KEY SHARE conflict
How the review tested this

Review: We checked the conflict matrix and surrounding lock descriptions. E-26 establishes mode compatibility. Its quoted range does not establish which mode the example's UPDATE acquires. Remove the example verification from this finding.

F8

Tuple headers store persistent row-lock information

ACCURATEFactual · holds up after review

Claim ledger

Article says
…stores lock information directly in the row’s internal system column ( xmax )…
What is true
heapam.c:5387-5393 writes lock flags and xmax into the tuple header. Ordinary row locks need no shared-memory entry per locked row. After marking the tuple, heapam.c:5480-5485 releases the heavyweight tuple lock if acquisition required one.
Charitable reading
The reference to xmax summarizes tuple-header ownership. It does not claim xmax alone encodes every lock mode or multiple locker.

Source

Source · REL_18_6 · src/backend/access/heap/heapam.c:5387-5393tuple->t_data->t_infomask &= ~HEAP_XMAX_BITS; tuple->t_data->t_infomask2 &= ~HEAP_KEYS_UPDATED; tuple->t_data->t_infomask |= new_infomask; tuple->t_data->t_infomask2 |= new_infomask2; if (HEAP_XMAX_IS_LOCKED_ONLY(new_infomask)) HeapTupleHeaderClearHotUpdated(tuple->t_data); HeapTupleHeaderSetXmax(tuple->t_data, xid);
In the article · section “How locks work in PostgreSQL”

In the article

excerpt · section “How locks work in PostgreSQL” · as fetched 2026-10-21 · open in article ↗ (opens in new tab)

How locks work in PostgreSQL

The row lock implementation in PostgreSQL takes a unique approach. Instead of using shared memory, PostgreSQL stores lock information directly in the row’s internal system column ( xmax ). This design manages numerous row locks efficiently while using minimal memory compared to table-level locks stored in shared memory.

All sources and excerpts · 3
Evidence tuple->t_data->t_infomask &= ~HEAP_XMAX_BITS; tuple->t_data->t_infomask2 &= ~HEAP_KEYS_UPDATED; tuple->t_data->t_infomask |= new_infomask; tuple->t_data->t_infomask2 |= new_infomask2; if (HEAP_XMAX_IS_LOCKED_ONLY(new_infomask)) HeapTupleHeaderClearHotUpdated(tuple->t_data); HeapTupleHeaderSetXmax(tuple->t_data, xid);
Evidence /* * Now that we have successfully marked the tuple as locked, we can * release the lmgr tuple lock, if we had it. */ if (have_tuple_lock) UnlockTupleTuplock(relation, tid, mode);
Evidence <productname>PostgreSQL</productname> doesn't remember any information about modified rows in memory, so there is no limit on the number of rows locked at one time. However, locking a row
How the review tested this

Review: We tested whether xmax alone carries lock information. The finding includes tuple-header flags and conditional heavyweight-lock release, matching E-27 and E-28. We checked whether xmax alone stores every lock attribute. The finding correctly includes tuple-header flags. E-28 explicitly makes heavyweight lock release conditional on prior acquisition.

F10

The second update waits for the open transaction

ACCURATEFactual · holds up after review

Claim ledger

Article says
…In another session, trying to update the same row would hang waiting for a row lock…
What is true
The second UPDATE waits while the first transaction holds the conflicting row lock. PostgreSQL 18 explicit-locking documentation confirms this behavior. This verifies the blocking explanation, not the recorded session identifiers.
Charitable reading
The example leaves the first transaction open and uses the default blocking update behavior.

Source

Source · https://www.postgresql.org/docs/current/explicit-locking.htmla transaction seeking either a table-level or row-level lock will wait indefinitely for conflicting locks to be released.
In the article · section “Example of row locks”

In the article

excerpt · section “Example of row locks” · as fetched 2026-10-21 · open in article ↗ (opens in new tab)

Example of row locks

In another session, trying to update the same row would hang waiting for a row lock:

testdb=> BEGIN;
BEGIN

testdb=> SELECT pg_backend_pid(), txid_current();

 pg_backend_pid | txid_current
----------------+--------------
           2053 |      3194801

testdb=> UPDATE my_tab
SET val = -100
WHERE id = 888;

<hangs>
All sources and excerpts · 1
Evidencea transaction seeking either a table-level or row-level lock will wait indefinitely for conflicting locks to be released.
How the review tested this

Review: We checked the open-transaction premise and the retrieved documentation version. E-31 supports waiting for conflicting locks. The finding excludes verification of recorded identifiers. We checked the open-transaction hypothesis and the fetched page's version label. The page identifies PostgreSQL 18 and confirms conflicting-lock waits. The finding limits verification to blocking behavior.

F12

Verified accurate: “…PostgreSQL will also record when a waiting session is able to acquire the lock…”

ACCURATEFactual · partly holds after review

Claim ledger

Article says
…PostgreSQL will also record when a waiting session is able to acquire the lock…
What is true
REL_18_6 src/backend/storage/lmgr/proc.c:1653-1656 logs acquisition when myWaitStatus equals PROC_WAIT_STATUS_OK within the logging block. The message includes elapsed milliseconds. This verifies the successful-acquisition message format, not the example's recorded elapsed time.

Source

Source · REL_18_6 · src/backend/storage/lmgr/proc.c:1630-1695(errmsg("process %d acquired %s on %s after %ld.%03d ms",
In the article · section “Logging using the log_lock_waits parameter”

In the article

excerpt · section “Logging using the log_lock_waits parameter” · as fetched 2026-10-21 · open in article ↗ (opens in new tab)

Logging using the log_lock_waits parameter

PostgreSQL will also record when a waiting session is able to acquire the lock:

LOG: process 2053 acquired ShareLock on transaction 3194633 after 225589.817 ms
CONTEXT: while updating tuple (3,210) in relation "my_tab"
STATEMENT: update my_tab
set val = -100
where id = 888;
All sources and excerpts · 1
Evidence (errmsg("process %d acquired %s on %s after %ld.%03d ms",
How the review tested this

Review: We checked the successful-wait branch and its enclosing condition. E-35 includes the branch and message. Its range excludes the log_lock_waits guard at line 1592. Narrow verification to the branch and message format.

F13

Historical lock analysis requires collecting view contents

ACCURATEFactual · holds up after review

Claim ledger

Article says
Querying pg_stat_activity and pg_locks requires constant monitoring…
What is true
pg_stat_activity describes current process activity. pg_locks describes active locks. PostgreSQL 18.6 documents those scopes in monitoring.sgml:714 and system-views.sgml:1665. Historical analysis requires retaining observations over time.
Charitable reading
Constant monitoring means ongoing collection for historical analysis, rather than an uninterrupted SQL query.

Source

Source · REL_18_6 · doc/src/sgml/monitoring.sgml:713-717The <structname>pg_stat_activity</structname> view will have one row per server process, showing information related to the current activity of that process.
In the article

In the article

Article · exact quote · open in article ↗ (opens in new tab)Querying pg_stat_activity and pg_locks requires constant monitoring…
All sources and excerpts · 2
Evidence The <structname>pg_stat_activity</structname> view will have one row per server process, showing information related to the current activity of that process.
Evidence information about the locks held by active processes within the database server.
How the review tested this

Review: We tested whether current activity or active locks provide historical records. E-37 and E-38 describe current state. The finding requires retained observations, without claiming complete capture. We tested whether constant monitoring requires an uninterrupted query. The finding reasonably reads it as ongoing collection. E-37 and E-38 describe current activity and active locks, without historical retention.

F14

deadlock_timeout defaults to one second

ACCURATEFactual · holds up after review

Claim ledger

Article says
…deadlock_timeout (default 1 second)…
What is true
PostgreSQL 18.6 defines deadlock_timeout as 1,000 milliseconds by default. src/backend/utils/misc/guc_tables.c:2269 specifies milliseconds. Line 2272 sets the default to 1,000.
Charitable reading
The article states the PostgreSQL default, rather than claiming every configured cluster uses that value.

Source

Source · REL_18_6 · src/backend/utils/misc/guc_tables.c:2266-2274 GUC_UNIT_MS }, &DeadlockTimeout, 1000, 1, INT_MAX,
In the article · section “Logging using the log_lock_waits parameter”

In the article

excerpt · section “Logging using the log_lock_waits parameter” · as fetched 2026-10-21 · open in article ↗ (opens in new tab)

Logging using the log_lock_waits parameter

The log_lock_waits parameter logs lock wait events that exceed deadlock_timeout (default 1 second) in the database log. The following is an example log excerpt when lock wait logging is enabled:

LOG: process 2053 still waiting for ShareLock on transaction 3194633 after 1000.086 ms
DETAIL: Process holding the lock: 1943. Wait queue: 2053.
CONTEXT: while updating tuple (3,210) in relation "my_tab"
STATEMENT: update my_tab
set val = -100
where id = 888;
All sources and excerpts · 2
Evidence GUC_UNIT_MS }, &DeadlockTimeout, 1000, 1, INT_MAX,
EvidenceThe default is one second ( 1s )
How the review tested this

Review: We checked the unit and default independently. E-40 specifies 1,000 milliseconds. E-43 agrees. The finding does not assert an observed cluster setting. We checked units and distinguished the default from cluster configuration. E-40 specifies 1,000 milliseconds. The fetched PostgreSQL 18 documentation independently confirms one second.

F15

The stated throughput rates imply a 55% reduction

ACCURATEFactual · holds up after review

Claim ledger

Article says
Throughput dropped to approximately 4,900 transactions per second, a 55 percent reduction…
What is true
Throughput falls by 55.0% (derived: 100 × (10,900 − 4,900) / 10,900). The remaining throughput is 45.0% of baseline. Both percentages match the article's rounding.
Charitable reading
The article rounds both throughput rates and the percentage.

Checked for internal consistency: the evidence is the article itself.

In the article

In the article

Article · exact quote · open in article ↗ (opens in new tab)Throughput dropped to approximately 4,900 transactions per second, a 55 percent reduction…
How the review tested this

Review: We recalculated the reduction as 55.0459% and remaining throughput as 44.9541%. Both round correctly. The finding verifies arithmetic, not measurements or causation. We recomputed the reduction as 55.0459% and remaining throughput as 44.9541%. Both round as stated. The finding verifies arithmetic without authenticating measurements or attributing causation.

Notes

2 not graded: findings no reader would act on differently
F1

Note: “It then acquires a temporary tuple lock in shared memory…”

NOTEpartly holds after review

Claim ledger

Article says
It then acquires a temporary tuple lock in shared memory…
What is true
Heavyweight tuple-lock acquisition is conditional, as README.tuplock:36-37 and heapam.c:5150-5152 show. The article describes the contended path without stating that qualification. Its monitoring advice already uses transaction-ID waits and pg_blocking_pids(). The wording does not establish wasted diagnostic work.
So what
Use transaction-ID waits and pg_blocking_pids() to diagnose contention. Do not expect every locked row to have a heavyweight tuple-lock entry.

Source

Source · REL_18_6 · src/backend/access/heap/README.tuplock:36-37starve out waiting exclusive-lockers. However, if there is not any active conflict for a tuple, we don't incur any extra overhead.

Not graded: no reader would act differently on it.

In the article · section “How locks work in PostgreSQL”

In the article

excerpt · section “How locks work in PostgreSQL” · as fetched 2026-10-21 · open in article ↗ (opens in new tab)

How locks work in PostgreSQL

To lock a row, PostgreSQL first checks for existing locks on the target row. It then acquires a temporary tuple lock in shared memory to process the lock request. After writing the lock information to the row metadata, it releases the temporary tuple lock.

All sources and excerpts · 3
Evidencestarve out waiting exclusive-lockers. However, if there is not any active conflict for a tuple, we don't incur any extra overhead.
Evidence if (!skip_tuple_lock && !heap_acquire_tuplock(relation, tid, mode, wait_policy, &have_tuple_lock))
Evidence /* * Now that we have successfully marked the tuple as locked, we can * release the lmgr tuple lock, if we had it. */ if (have_tuple_lock) UnlockTupleTuplock(relation, tid, mode);
How the review tested this

Review: The acquisition caveat survives, but the claimed diagnostic cost does not. The article describes temporary locks and already recommends transaction-ID diagnostics. F1's reader action repeats that advice. The unconditional acquisition description is wrong. The claimed diagnostic cost does not follow. The article explains temporary lock release and recommends transaction-ID monitoring. Its monitoring guidance already matches the proposed reader action.

F9

The blockers array contains blocking PIDs

NOTEholds up after review

Claim ledger

Article says
…blocking process ID ( pid )…
What is true
The pid column identifies the inspected session. The blockers array contains that session's blocking process IDs. The example correctly shows session 2053 blocked by session 1943. Only the introductory column label reverses these meanings.
Charitable reading
The displayed blockers array and example output communicate the relationship correctly. The introductory column label is the defect.

Source

Source · REL_18_6 · doc/src/sgml/func.sgml:25002-25005One server process blocks another if it either holds a lock that conflicts with the blocked process's lock request (hard block), or is waiting for a lock that would conflict with the blocked process's lock request and is ahead of it in the wait queue (soft block). When using

Not graded: knowing this would not change what a reader does.

In the article · section “Monitoring locks using system views and functions”

In the article

excerpt · section “Monitoring locks using system views and functions” · as fetched 2026-10-21 · open in article ↗ (opens in new tab)

Monitoring locks using system views and functions

PostgreSQL provides system views and functions to identify blocking sessions. The pg_stat_activity view combined with the pg_blocking_pids() function shows lock relationships between sessions. The following query returns the blocking process ID ( pid ) and details of the blocked process:

testdb=> select pid, pg_blocking_pids(pid) as blockers, wait_event_type, wait_event, state, backend_xid, query
from pg_stat_activity
where pid in (1943, 2053);

 pid  | blockers | wait_event_type |  wait_event   |        state        | backend_xid |                  query
------+----------+-----------------+---------------+---------------------+-------------+------------------------------------------
 1943 | {}       | Client          | ClientRead    | idle in transaction |     3194633 | select pg_backend_pid(), txid_current();
 2053 | {1943}   | Lock            | transactionid | active              |     3194801 | update my_tab
      |          |                 |               |                     |             | set val = -100
      |          |                 |               |                     |             | where id = 888;
All sources and excerpts · 2
Evidence One server process blocks another if it either holds a lock that conflicts with the blocked process's lock request (hard block), or is waiting for a lock that would conflict with the blocked process's lock request and is ahead of it in the wait queue (soft block). When using
Evidence /* blocked by this entry, so emit a record */ arrayelems[narrayelems++] = Int32GetDatum(instance->leaderPid);
How the review tested this

Review: We tested the charitable reading that the query returns both kinds of PID. It does. The note correctly limits the defect to the introductory label. We checked whether the introductory wording changes the displayed diagnosis. The output identifies blockers correctly. E-14 confirms that pg_blocking_pids() supplies blocker identifiers. A note matches the limited wording defect.

More in this report

Section checks · 7 sections

Section checks

AspectGradeFindingsCoverage
Lock internalsA2 verified-accurate75% of claims (12 of 16, plus 1 that need data we do not have)
Row lock exampleA2 verified-accurate92% of claims (12 of 13)
Flash-sale loadA1 verified-accurate1 checked · 9 need data we do not have
System viewsA2 verified-accurate100% of claims (18 of 18, plus 4 that need data we do not have)
Row lock inspectionA1 verified-accurate100% of claims (10 of 10, plus 2 that need data we do not have)
Lock wait loggingA3 verified-accurate100% of claims (4 of 4, plus 4 that need data we do not have)
ConclusionA1 verified-accurate100% of claims (3 of 3)
Coverage and assessment · Checked 67 of 75 Postgres claims across 15 sections; 2 sections below half

A — the findings address the article's main subject. What we did not check is listed below. The findings directly check Part 1’s row-lock mechanisms, blocking-session queries, row inspection, and lock-wait logging.

We did not check everything in this article. What we did not check is listed below, in the words we recorded at the time. None of it moved the letter. We never charge our own limits to the article.

What we did not check

  • We did not reproduce the throughput, wait-event percentages, or session measurements the article displays.
  • We did not inspect the article's five dashboard figures.
  • We did not verify the accompanying schema, data generator, workload scripts, or retry implementation.
  • We did not verify Aurora's storage implementation or service-specific configuration and cleanup behavior.
  • We did not verify the CloudWatch transaction metric or its mapping to completed orders.
  • We did not finish checking checkpoint writes or the investigation approach's applicability to every workload.
  • We did not read the five Database Insights chart images or verify their underlying measurements.
  • We did not reproduce the displayed SQL outputs or workload measurements.
  • We did not inspect the workload scripts or CloudFormation templates to verify their behavior.
  • We did not establish equal applicability of every Aurora monitoring feature to RDS PostgreSQL.
  • We did not establish post-publication changes to Aurora monitoring features.
  • We did not verify the claimed lock frequency, memory comparison, concurrency improvement, or reduction in deadlock risk.
  • We did not reproduce the throughput and lock-wait measurements.
  • We did not read Figures 1–5 to verify the throughput charts or the 95% database-load total.
  • We did not verify the test's row counts, session counts, item counts, or db.r8g.4xlarge instance configuration.
  • Safe: we did not complete every applicable check.
  • Section “Prerequisites”: we checked 0 of 2 checkable claims.
  • Section “Average load”: we checked 0 of 12 checkable claims.
  • We could not decide whether the article contains a material benchmark.
Checked 67 of 75 Postgres claims across 15 sections; 2 sections below half
  • Introduction: 5 of 5 Postgres claims checked, plus 3 that need data we do not have; not counted: 3 product or opinion, 1 duplicate, 3 not a claim
  • Prerequisites: 0 of 1 Postgres claims checked, plus 1 that need data we do not have; not counted: 6 product or opinion; not checked: 1 for other reasons
  • Lock internals: 12 of 16 Postgres claims checked, plus 1 that need data we do not have; not counted: 2 product or opinion, 1 duplicate, 1 not a claim; not checked: 4 for other reasons
  • Row lock example: 12 of 13 Postgres claims checked; not counted: 3 duplicate, 1 not a claim; not checked: 1 for other reasons
  • Workload schema: 3 of 3 Postgres claims checked, plus 12 that need data we do not have; not counted: 5 product or opinion, 1 duplicate, 3 not a claim
  • Average load: 0 of 2 Postgres claims checked, plus 10 that need data we do not have; not counted: 1 product or opinion, 2 duplicate, 1 not a claim; not checked: 2 for other reasons
  • Flash-sale load: 1 checked, plus 9 that need data we do not have; not counted: 4 product or opinion, 6 duplicate, 1 not a claim
  • Contention scenarios: no checkable claims; not counted: 5 product or opinion, 1 duplicate
  • Monitoring locks: no checkable claims; not counted: 1 product or opinion, 2 not a claim
  • System views: 18 of 18 Postgres claims checked, plus 4 that need data we do not have; not counted: 2 duplicate
  • Row lock inspection: 10 of 10 Postgres claims checked, plus 2 that need data we do not have; not counted: 1 not a claim
  • Lock wait logging: 4 of 4 Postgres claims checked, plus 4 that need data we do not have; not counted: 3 duplicate, 1 not a claim
  • Cleanup: no checkable claims; not counted: 12 product or opinion, 2 not a claim
  • Conclusion: 3 of 3 Postgres claims checked; not counted: 4 product or opinion, 6 duplicate, 2 not a claim
  • Authors: no checkable claims; not counted: 8 not a claim

Average of 3 axes: 4 · result A

Some explanatory text is not shown in this edition; the grade and findings are complete.

Scorecard · the five axes
FACTS scorecard Scorecard radar, 5 axes, bigger is better. Overall A. Factual A · 0 wrong of 12 checked · 0 caveats. Applicable A · 0 wrong of 5 checked · 0 caveats. Consistent A · 0 wrong of 12 checked · 0 caveats. Transparent 2 checked, too few for a letter. Safe not applicable (n/a). A 0 wrong of 12 checked · 0 caveatsFactual A0 wrong of 120 caveats A 0 wrong of 5 checked · 0 caveatsApplicable A0 wrong of 50 caveats A 0 wrong of 12 checked · 0 caveatsConsistent A0 wrong of 120 caveats 2 checked, too few for a letterTransparent n/a0 wrong of 20 caveats not applicable (n/a), 17 commands scanned none riskySafe n/a17 commands scannednone risky A

By topic: Lock internals — 2 findings, 0 wrong · Row lock example — 2 findings, 0 wrong · Flash-sale load — 1 finding, 0 wrong · System views — 2 findings, 0 wrong · Row lock inspection — 1 finding, 0 wrong · Lock wait logging — 3 findings, 0 wrong · Conclusion — 1 finding, 0 wrong

Further out is better. Each axis has its own letter, from the wrong claims and caveats among the claims we checked of that kind.

Checked on the FACTS: Factual, Applicable, Consistent, Transparent, Safe. Clockwise: Factual (is it true?), Applicable (does it apply to my setup, today?), Consistent (does it agree with itself?), Transparent (can I check it myself?), Safe (can I run this on prod?).

We checked 12 claims, 17 commands scanned.

AxisLetterWrongCaveatsCheckedCoverage
FactualA0012assessed: A · 0 wrong of 12 checked · 0 caveats
ApplicableA005assessed: A · 0 wrong of 5 checked · 0 caveats
ConsistentA0012assessed: A · 0 wrong of 12 checked · 0 caveats
Transparent—002assessed: 0 wrong · 0 caveats · 2 checked
Safe—000partly assessed
Topics · 7 topics

Topics

TopicFactualApplicableConsistentTransparentSafe
Lock internals0 issues 2 checked F7 F80 issues 2 checked
Row lock example0 issues 2 checked F4 F100 issues 1 checked0 issues 2 checked0 issues 1 checked
Flash-sale load0 issues 1 checked F150 issues 1 checked
System views0 issues 2 checked F2 F30 issues 2 checked
Row lock inspection0 issues 1 checked F60 issues 1 checked0 issues 1 checked
Lock wait logging0 issues 3 checked F5 F12 F140 issues 3 checked0 issues 3 checked
Conclusion0 issues 1 checked F130 issues 1 checked0 issues 1 checked

Issues found among the claims checked, per topic and axis. Each link goes to the finding behind the count.

Revisions: 6 · B -> B -> A -> A -> A -> A

We audited this article 6 times. Each row is the final edition of one audit. Letters and findings of earlier revisions stay readable at their own address.

  1. Revision 1 · 2026-10-16 12:37 UTC · B · audited with v1.0.8 (approx.)

    Article as first submitted. 10 accurate · 0 wrong · 1 caveat.

    ElephantSeal: B. Open: the benchmark cannot yet be rerun from what is published.

    Changes: First audit. Open: F1 “Temporary tuple locks arbitrate conflicts” (mostly accurate).

  2. Revision 2 · 2026-10-18 18:00 UTC · B · audited with v1.0.11 (approx.)

    Same article text, re-audited. 13 accurate · 0 wrong · 0 caveats.

    ElephantSeal: B. Open: the benchmark cannot yet be rerun from what is published.

    Changes: No longer reported: “Temporary tuple locks arbitrate conflicts”. New: none.

  3. Revision 3 · 2026-10-18 21:51 UTC · A · audited with v1.0.12 (approx.)

    Same article text, re-audited. 13 accurate · 0 wrong · 0 caveats.

    ElephantSeal: A.

    Changes: No change in findings.

  4. Revision 4 · 2026-10-19 03:35 UTC · A · audited with v1.0.13 (approx.)

    Same article text, re-audited. 14 accurate · 0 wrong · 0 caveats.

    ElephantSeal: A.

    Changes: No change in findings.

  5. Revision 5 · 2026-10-19 21:33 UTC · A · audited with v1.0.16 (approx.)

    Same article text, re-audited. 13 accurate · 0 wrong · 0 caveats.

    ElephantSeal: A.

    Changes: No change in findings.

  6. Revision 6 · this page · 2026-10-21 03:56 UTC · A · audited with v1.0.17 (approx.) · regraded with v1.1.3

    Same article text, re-audited. 12 accurate · 0 wrong · 0 caveats.

    ElephantSeal: A.

    Changes: No change in findings.

Questions and answers

Questions and answers

What is pgTrue?

pgTrue is an independent fact-check of technical Postgres articles, made by PostgresAI. It helps you check advice before you use it.

What does the letter grade mean?

The letter grade summarizes the claims we checked. Five axes show what we checked:

  • Factual: is it true?
  • Applicable: does it apply to my setup, today?
  • Consistent: does it agree with itself?
  • Transparent: can I check it myself?
  • Safe: can I run this in production?

What is the ElephantSeal?

The ElephantSeal is the mark an article earns. It always shows the latest edition. “Open:” lists what is still open.

Can an author reply?

Authors can ask us to correct a finding, reply to it, or withdraw it. Right-of-reply policy.

Paste into your AI assistant to fix the article, then ask for a re-review.

Show the text
Fix the article with this report, then ask pgTrue for a re-review.

# pgTrue report: Troubleshooting row lock contention in Amazon Aurora PostgreSQL: Part 1 – Understanding row lock contention in PostgreSQL \| Amazon Web Services

Article title: Troubleshooting row lock contention in Amazon Aurora PostgreSQL: Part 1 – Understanding row lock contention in PostgreSQL \| Amazon Web Services
Article URL: https://aws.amazon.com/blogs/database/troubleshooting-row-lock-contention-in-amazon-aurora-postgresql-part-1-understanding-row-lock-contention-in-postgresql
Report URL: https://pgtrue.postgres.ai/shared/brief/f01d0141-796c-4a87-a3bf-3ec19aa9cc7d
Audited revision: 6 of 6, 2026-10-21 03:56:36 UTC
Overall letter: A

## Axes

- Factual: A · 0 wrong · 12 checked · 0 caveats · assessed
- Applicable: A · 0 wrong · 5 checked · 0 caveats · assessed
- Consistent: A · 0 wrong · 12 checked · 0 caveats · assessed
- Transparent: — · 0 wrong · 2 checked · 0 caveats · assessed
- Safe: — · 0 wrong · 0 checked · 0 caveats · partly assessed

ElephantSeal: A.

## Report metadata

- Report: Technical fact-check, edition 3
- pgTrue version: audited with v1.0.17 (approx.) · regraded with v1.1.3
- Issued: 2026-10-21
- Edition: Updated after review. Corrections are listed below.
- Submitted: Submitted by the PostgresAI team.
- Author response: No written reply from the author. We re-audited this article 5 times; see Revisions below. Policy: [right-of-reply and corrections policy](/pgtrue/security).

## Findings needing a change (0)

None.

## Verified accurate claims (12)

### F2 · Accurate · Factual · Session activity and blocker discovery support the monitoring query
Location: excerpt · section “Monitoring locks using system views and functions” · as fetched 2026-10-21 · [open in article](https://aws.amazon.com/blogs/database/troubleshooting-row-lock-contention-in-amazon-aurora-postgresql-part-1-understanding-row-lock-contention-in-postgresql#:~:text=view%20combined%20with%20the%20pg_blocking_pids%28%29,shows%20lock%20relationships%20between%20sessions)
Article says:
```text
…view combined with the pg_blocking_pids() function shows lock relationships between sessions…
```
What is true:
pg_stat_activity supplies the selected session fields. pg_blocking_pids() identifies incompatible lock holders and conflicting waiters ahead in the queue. system_views.sql:894-900 defines the activity fields. lockfuncs.c:553-554 emits blocking process IDs.
Charitable reading:
The article uses the function for lock relationships, not arbitrary waits such as buffer pins.
Review: We tested whether the finding overlooks queued blockers. E-12 explicitly includes hard and soft blocking. The selected activity fields match E-13. We tested whether blocker discovery excludes queued blockers. E-12 explicitly includes conflicting waiters ahead in the queue. The selected activity fields and emitted blocker identifiers match the finding.

Sources:
- [REL_18_6 · doc/src/sgml/func.sgml:25002-25005](https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/doc/src/sgml/func.sgml#L25002-L25005)
  Excerpt:
  ```text
  One server process blocks another if it either holds a lock that
        conflicts with the blocked process's lock request (hard block), or is
        waiting for a lock that would conflict with the blocked process's lock
        request and is ahead of it in the wait queue (soft block).  When using
  ```
- [REL_18_6 · src/backend/catalog/system_views.sql:894-900](https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/catalog/system_views.sql#L894-L900)
  Excerpt:
  ```text
  S.wait_event_type,
            S.wait_event,
            S.state,
            S.backend_xid,
            s.backend_xmin,
            S.query_id,
            S.query,
  ```
- [REL_18_6 · src/backend/utils/adt/lockfuncs.c:553-554](https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/utils/adt/lockfuncs.c#L553-L554)
  Excerpt:
  ```text
  /* blocked by this entry, so emit a record */
			arrayelems[narrayelems++] = Int32GetDatum(instance->leaderPid);
  ```

Finding URL: https://pgtrue.postgres.ai/shared/brief/f01d0141-796c-4a87-a3bf-3ec19aa9cc7d#F2

### F3 · Accurate · Factual · The transaction-ID query does not enumerate tuple-header locks
Location: excerpt · section “Monitoring locks using system views and functions” · as fetched 2026-10-21 · [open in article](https://aws.amazon.com/blogs/database/troubleshooting-row-lock-contention-in-amazon-aurora-postgresql-part-1-understanding-row-lock-contention-in-postgresql#:~:text=not%20the%20individual%20row%20locks%20stored%20in%20data%20pages)
Article says:
```text
…not the individual row locks stored in data pages…
```
What is true:
pg_locks normally represents a row-lock wait through the holder's transaction ID. It does not enumerate every locked tuple. system-views.sgml:1916-1921 documents this distinction. The article's transaction-ID filter matches that behavior.
Charitable reading:
The sentence describes tuple-header locks and the transaction-ID-filtered example. It does not deny heavyweight tuple locks exist.
Review: We tested whether heavyweight tuple locks contradict the finding. Its distinction concerns tuple-header ownership and the transaction-ID-filtered query. E-15 supports that distinction. We tested whether heavyweight tuple entries contradict this finding. E-15 distinguishes stored row locks from transaction-ID waits. The article's filtered query supports the narrower interpretation.

Sources:
- [REL_18_6 · doc/src/sgml/system-views.sgml:1916-1921](https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/doc/src/sgml/system-views.sgml#L1916-L1921)
  Excerpt:
  ```text
  Although tuples are a lockable type of object,
   information about row-level locks is stored on disk, not in memory,
   and therefore row-level locks normally do not appear in this view.
   If a process is waiting for a
   row-level lock, it will usually appear in the view as waiting for the
   permanent transaction ID of the current holder of that row lock.
  ```
- [REL_18_6 · src/backend/catalog/system_views.sql:397-398](https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/catalog/system_views.sql#L397-L398)
  Excerpt:
  ```text
  CREATE VIEW pg_locks AS
    SELECT * FROM pg_lock_status() AS L;
  ```

Finding URL: https://pgtrue.postgres.ai/shared/brief/f01d0141-796c-4a87-a3bf-3ec19aa9cc7d#F3

### F4 · Accurate · Factual · The identifier query returns the current backend and transaction
Location: excerpt · section “Example of row locks” · as fetched 2026-10-21 · [open in article](https://aws.amazon.com/blogs/database/troubleshooting-row-lock-contention-in-amazon-aurora-postgresql-part-1-understanding-row-lock-contention-in-postgresql#:~:text=SELECT%20pg_backend_pid%28%29%2C%20txid_current%28%29%3B)
Article says:
```text
…SELECT pg_backend_pid(), txid_current();…
```
What is true:
pg_backend_pid() returns MyProcPid in pgstatfuncs.c:692. txid_current() returns the current top-level transaction ID. It assigns an ID when necessary. The article uses both functions consistently with their documented meanings.
Charitable reading:
The displayed identifiers are examples, not values another installation must return.
Review: We checked ID assignment and subtransaction semantics. E-18 links txid_current() to the behavior documented in E-19. The finding does not authenticate displayed identifiers. We checked transaction-ID assignment and subtransaction behavior. E-18 connects txid_current() to the documented current-ID function. E-19 confirms assignment and top-level transaction semantics. The finding does not authenticate example identifiers.

Sources:
- [REL_18_6 · src/backend/utils/adt/pgstatfuncs.c:689-693](https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/utils/adt/pgstatfuncs.c#L689-L693)
  Excerpt:
  ```text
  Datum
pg_backend_pid(PG_FUNCTION_ARGS)
{
	PG_RETURN_INT32(MyProcPid);
}
  ```
- [REL_18_6 · doc/src/sgml/func.sgml:27810-27814](https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/doc/src/sgml/func.sgml#L27810-L27814)
  Excerpt:
  ```text
  <function>txid_current</function> ()
        <returnvalue>bigint</returnvalue>
       </para>
       <para>
        See <function>pg_current_xact_id()</function>.
  ```
- [REL_18_6 · doc/src/sgml/func.sgml:27560-27564](https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/doc/src/sgml/func.sgml#L27560-L27564)
  Excerpt:
  ```text
  Returns the current transaction's ID.  It will assign a new one if the
        current transaction does not have one already (because it has not
        performed any database updates);  see <xref
        linkend="transaction-id"/> for details.  If executed in a
        subtransaction, this will return the top-level transaction ID;
  ```

Finding URL: https://pgtrue.postgres.ai/shared/brief/f01d0141-796c-4a87-a3bf-3ec19aa9cc7d#F4

### F5 · Accurate · Factual · Enabled lock-wait logging uses the deadlock timeout
Location: excerpt · section “Logging using the log_lock_waits parameter” · as fetched 2026-10-21 · [open in article](https://aws.amazon.com/blogs/database/troubleshooting-row-lock-contention-in-amazon-aurora-postgresql-part-1-understanding-row-lock-contention-in-postgresql#:~:text=logs%20lock%20wait%20events%20that%20exceed%20deadlock_timeout%20%28default%201%20second%29)
Article says:
```text
…logs lock wait events that exceed deadlock_timeout (default 1 second)…
```
What is true:
log_lock_waits reports waits after deadlock_timeout. The default delay is 1,000 milliseconds in guc_tables.c:2266-2274. proc.c:1592 gates reporting on enabled logging and the deadlock check. proc.c:1653-1656 also logs eventual acquisition.
Charitable reading:
The article explicitly conditions its example on enabled lock-wait logging.
Review: We tested the disabled-by-default objection. The article and finding condition reporting on enabled log_lock_waits. E-22 confirms the reporting gate. We checked whether disabled logging defeats the claim. Both the finding and surrounding article condition the example on enabled logging. The source confirms the threshold, default, and acquisition message.

Sources:
- [REL_18_6 · doc/src/sgml/config.sgml:8041-8044](https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/doc/src/sgml/config.sgml#L8041-L8044)
  Excerpt:
  ```text
  Controls whether a log message is produced when a session waits
        longer than <xref linkend="guc-deadlock-timeout"/> to acquire a
        lock.  This is useful in determining if lock waits are causing
        poor performance.  The default is <literal>off</literal>.
  ```
- [REL_18_6 · src/backend/utils/misc/guc_tables.c:2266-2274](https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/utils/misc/guc_tables.c#L2266-L2274)
  Excerpt:
  ```text
  {"deadlock_timeout", PGC_SUSET, LOCK_MANAGEMENT,
			gettext_noop("Sets the time to wait on a lock before checking for deadlock."),
			NULL,
			GUC_UNIT_MS
		},
		&DeadlockTimeout,
		1000, 1, INT_MAX,
		NULL, NULL, NULL
	},
  ```
- [REL_18_6 · src/backend/storage/lmgr/proc.c:1588-1592](https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/storage/lmgr/proc.c#L1588-L1592)
  Excerpt:
  ```text
  /*
		 * If awoken after the deadlock check interrupt has run, and
		 * log_lock_waits is on, then report about the wait.
		 */
		if (log_lock_waits && deadlock_state != DS_NOT_YET_CHECKED)
  ```
- [REL_18_6 · src/backend/storage/lmgr/proc.c:1653-1656](https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/storage/lmgr/proc.c#L1653-L1656)
  Excerpt:
  ```text
  else if (myWaitStatus == PROC_WAIT_STATUS_OK)
				ereport(LOG,
						(errmsg("process %d acquired %s on %s after %ld.%03d ms",
								MyProcPid, modename, buf.data, msecs, usecs)));
  ```

Finding URL: https://pgtrue.postgres.ai/shared/brief/f01d0141-796c-4a87-a3bf-3ec19aa9cc7d#F5

### F6 · Accurate · Factual · pgrowlocks scans the table to inspect row locks
Location: excerpt · section “Examining row locks using the pgrowlocks extension” · as fetched 2026-10-21 · [open in article](https://aws.amazon.com/blogs/database/troubleshooting-row-lock-contention-in-amazon-aurora-postgresql-part-1-understanding-row-lock-contention-in-postgresql#:~:text=pgrowlocks%20performs%20a%20full%20table%20scan)
Article says:
```text
…pgrowlocks performs a full table scan…
```
What is true:
pgrowlocks reads rows sequentially to collect lock information. pgrowlocks.c:116-124 starts the scan and repeatedly fetches tuples. pgrowlocks.sgml:93-95 warns about large-table cost. The article correctly warns against unrestricted production scans.
Charitable reading:
Avoiding production use is conservative operational advice, not a claim that PostgreSQL forbids it.
Review: We checked whether pgrowlocks restricts its scan to locked rows. E-25 starts an unrestricted scan. The finding treats production avoidance as operational advice. We tested whether the scan uses filtering or guarantees production disruption. E-25 shows an unrestricted scan and tuple loop. E-24 warns about large-table cost. The finding treats production avoidance as conservative advice.

Sources:
- [REL_18_6 · doc/src/sgml/pgrowlocks.sgml:93-95](https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/doc/src/sgml/pgrowlocks.sgml#L93-L95)
  Excerpt:
  ```text
  <function>pgrowlocks</function> takes <literal>AccessShareLock</literal> for the
   target table and reads each row one by one to collect the row locking
   information.  This is not very speedy for a large table.  Note that:
  ```
- [REL_18_6 · contrib/pgrowlocks/pgrowlocks.c:116-124](https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/contrib/pgrowlocks/pgrowlocks.c#L116-L124)
  Excerpt:
  ```text
  /* Scan the relation */
	scan = table_beginscan(rel, GetActiveSnapshot(), 0, NULL);
	hscan = (HeapScanDesc) scan;

	attinmeta = TupleDescGetAttInMetadata(rsinfo->setDesc);

	values = (char **) palloc(rsinfo->setDesc->natts * sizeof(char *));

	while ((tuple = heap_getnext(scan, ForwardScanDirection)) != NULL)
  ```

Finding URL: https://pgtrue.postgres.ai/shared/brief/f01d0141-796c-4a87-a3bf-3ec19aa9cc7d#F6

### F7 · Accurate · Factual · Verified accurate: “FOR UPDATE serves as the most restrictive mode…”
Location: excerpt · section “How locks work in PostgreSQL” · as fetched 2026-10-21 · [open in article](https://aws.amazon.com/blogs/database/troubleshooting-row-lock-contention-in-amazon-aurora-postgresql-part-1-understanding-row-lock-contention-in-postgresql#:~:text=FOR%20UPDATE%20serves%20as%20the%20most%20restrictive%20mode)
Article says:
```text
FOR UPDATE serves as the most restrictive mode…
```
What is true:
FOR UPDATE conflicts with all four row-lock modes. FOR NO KEY UPDATE permits FOR KEY SHARE. REL_18_6 src/backend/access/heap/README.tuplock:65-69 gives this conflict table. This verifies the mode ordering, not the displayed UPDATE execution.
Review: We checked the conflict matrix and surrounding lock descriptions. E-26 establishes mode compatibility. Its quoted range does not establish which mode the example's UPDATE acquires. Remove the example verification from this finding.

Sources:
- [REL_18_6 · src/backend/access/heap/README.tuplock:65-69](https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/access/heap/README.tuplock#L65-L69)
  Excerpt:
  ```text
  UPDATE       NO KEY UPDATE    SHARE        KEY SHARE
UPDATE           conflict        conflict      conflict      conflict
NO KEY UPDATE    conflict        conflict      conflict
SHARE            conflict        conflict
KEY SHARE        conflict
  ```

Finding URL: https://pgtrue.postgres.ai/shared/brief/f01d0141-796c-4a87-a3bf-3ec19aa9cc7d#F7

### F8 · Accurate · Factual · Tuple headers store persistent row-lock information
Location: excerpt · section “How locks work in PostgreSQL” · as fetched 2026-10-21 · [open in article](https://aws.amazon.com/blogs/database/troubleshooting-row-lock-contention-in-amazon-aurora-postgresql-part-1-understanding-row-lock-contention-in-postgresql#:~:text=stores%20lock%20information%20directly%20in,system%20column%20%28%20xmax%20%29)
Article says:
```text
…stores lock information directly in the row’s internal system column ( xmax )…
```
What is true:
heapam.c:5387-5393 writes lock flags and xmax into the tuple header. Ordinary row locks need no shared-memory entry per locked row. After marking the tuple, heapam.c:5480-5485 releases the heavyweight tuple lock if acquisition required one.
Charitable reading:
The reference to xmax summarizes tuple-header ownership. It does not claim xmax alone encodes every lock mode or multiple locker.
Review: We tested whether xmax alone carries lock information. The finding includes tuple-header flags and conditional heavyweight-lock release, matching E-27 and E-28. We checked whether xmax alone stores every lock attribute. The finding correctly includes tuple-header flags. E-28 explicitly makes heavyweight lock release conditional on prior acquisition.

Sources:
- [REL_18_6 · src/backend/access/heap/heapam.c:5387-5393](https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/access/heap/heapam.c#L5387-L5393)
  Excerpt:
  ```text
  tuple->t_data->t_infomask &= ~HEAP_XMAX_BITS;
	tuple->t_data->t_infomask2 &= ~HEAP_KEYS_UPDATED;
	tuple->t_data->t_infomask |= new_infomask;
	tuple->t_data->t_infomask2 |= new_infomask2;
	if (HEAP_XMAX_IS_LOCKED_ONLY(new_infomask))
		HeapTupleHeaderClearHotUpdated(tuple->t_data);
	HeapTupleHeaderSetXmax(tuple->t_data, xid);
  ```
- [REL_18_6 · src/backend/access/heap/heapam.c:5480-5485](https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/access/heap/heapam.c#L5480-L5485)
  Excerpt:
  ```text
  /*
	 * Now that we have successfully marked the tuple as locked, we can
	 * release the lmgr tuple lock, if we had it.
	 */
	if (have_tuple_lock)
		UnlockTupleTuplock(relation, tid, mode);
  ```
- [REL_18_6 · doc/src/sgml/mvcc.sgml:1353-1355](https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/doc/src/sgml/mvcc.sgml#L1353-L1355)
  Excerpt:
  ```text
  <productname>PostgreSQL</productname> doesn't remember any
     information about modified rows in memory, so there is no limit on
     the number of rows locked at one time.  However, locking a row
  ```

Finding URL: https://pgtrue.postgres.ai/shared/brief/f01d0141-796c-4a87-a3bf-3ec19aa9cc7d#F8

### F10 · Accurate · Factual · The second update waits for the open transaction
Location: excerpt · section “Example of row locks” · as fetched 2026-10-21 · [open in article](https://aws.amazon.com/blogs/database/troubleshooting-row-lock-contention-in-amazon-aurora-postgresql-part-1-understanding-row-lock-contention-in-postgresql#:~:text=In%20another%20session%2C%20trying%20to,waiting%20for%20a%20row%20lock)
Article says:
```text
…In another session, trying to update the same row would hang waiting for a row lock…
```
What is true:
The second UPDATE waits while the first transaction holds the conflicting row lock. PostgreSQL 18 explicit-locking documentation confirms this behavior. This verifies the blocking explanation, not the recorded session identifiers.
Charitable reading:
The example leaves the first transaction open and uses the default blocking update behavior.
Review: We checked the open-transaction premise and the retrieved documentation version. E-31 supports waiting for conflicting locks. The finding excludes verification of recorded identifiers. We checked the open-transaction hypothesis and the fetched page's version label. The page identifies PostgreSQL 18 and confirms conflicting-lock waits. The finding limits verification to blocking behavior.

Sources:
- [https://www.postgresql.org/docs/current/explicit-locking.html](https://www.postgresql.org/docs/current/explicit-locking.html)
  Excerpt:
  ```text
  a transaction seeking either a table-level or row-level lock will wait indefinitely for conflicting locks to be released.
  ```

Finding URL: https://pgtrue.postgres.ai/shared/brief/f01d0141-796c-4a87-a3bf-3ec19aa9cc7d#F10

### F12 · Accurate · Factual · Verified accurate: “…PostgreSQL will also record when a waiting session is able to acquire the lock…”
Location: excerpt · section “Logging using the log_lock_waits parameter” · as fetched 2026-10-21 · [open in article](https://aws.amazon.com/blogs/database/troubleshooting-row-lock-contention-in-amazon-aurora-postgresql-part-1-understanding-row-lock-contention-in-postgresql#:~:text=PostgreSQL%20will%20also%20record%20when,able%20to%20acquire%20the%20lock)
Article says:
```text
…PostgreSQL will also record when a waiting session is able to acquire the lock…
```
What is true:
REL_18_6 src/backend/storage/lmgr/proc.c:1653-1656 logs acquisition when myWaitStatus equals PROC_WAIT_STATUS_OK within the logging block. The message includes elapsed milliseconds. This verifies the successful-acquisition message format, not the example's recorded elapsed time.
Review: We checked the successful-wait branch and its enclosing condition. E-35 includes the branch and message. Its range excludes the log_lock_waits guard at line 1592. Narrow verification to the branch and message format.

Sources:
- [REL_18_6 · src/backend/storage/lmgr/proc.c:1630-1695](https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/storage/lmgr/proc.c#L1630-L1695)
  Excerpt:
  ```text
  (errmsg("process %d acquired %s on %s after %ld.%03d ms",
  ```

Finding URL: https://pgtrue.postgres.ai/shared/brief/f01d0141-796c-4a87-a3bf-3ec19aa9cc7d#F12

### F13 · Accurate · Factual · Historical lock analysis requires collecting view contents
Location: Article · exact quote · [open in article](https://aws.amazon.com/blogs/database/troubleshooting-row-lock-contention-in-amazon-aurora-postgresql-part-1-understanding-row-lock-contention-in-postgresql#:~:text=Querying%20pg_stat_activity%20and%20pg_locks%20requires%20constant%20monitoring)
Article says:
```text
Querying pg_stat_activity and pg_locks requires constant monitoring…
```
What is true:
pg_stat_activity describes current process activity. pg_locks describes active locks. PostgreSQL 18.6 documents those scopes in monitoring.sgml:714 and system-views.sgml:1665. Historical analysis requires retaining observations over time.
Charitable reading:
Constant monitoring means ongoing collection for historical analysis, rather than an uninterrupted SQL query.
Review: We tested whether current activity or active locks provide historical records. E-37 and E-38 describe current state. The finding requires retained observations, without claiming complete capture. We tested whether constant monitoring requires an uninterrupted query. The finding reasonably reads it as ongoing collection. E-37 and E-38 describe current activity and active locks, without historical retention.

Sources:
- [REL_18_6 · doc/src/sgml/monitoring.sgml:713-717](https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/doc/src/sgml/monitoring.sgml#L713-L717)
  Excerpt:
  ```text
  The <structname>pg_stat_activity</structname> view will have one row
   per server process, showing information related to
   the current activity of that process.
  ```
- [REL_18_6 · doc/src/sgml/system-views.sgml:1657-1736](https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/doc/src/sgml/system-views.sgml#L1657-L1736)
  Excerpt:
  ```text
  information about the locks held by active processes within the
   database server.
  ```

Finding URL: https://pgtrue.postgres.ai/shared/brief/f01d0141-796c-4a87-a3bf-3ec19aa9cc7d#F13

### F14 · Accurate · Factual · deadlock_timeout defaults to one second
Location: excerpt · section “Logging using the log_lock_waits parameter” · as fetched 2026-10-21 · [open in article](https://aws.amazon.com/blogs/database/troubleshooting-row-lock-contention-in-amazon-aurora-postgresql-part-1-understanding-row-lock-contention-in-postgresql#:~:text=deadlock_timeout%20%28default%201%20second%29)
Article says:
```text
…deadlock_timeout (default 1 second)…
```
What is true:
PostgreSQL 18.6 defines deadlock_timeout as 1,000 milliseconds by default. src/backend/utils/misc/guc_tables.c:2269 specifies milliseconds. Line 2272 sets the default to 1,000.
Charitable reading:
The article states the PostgreSQL default, rather than claiming every configured cluster uses that value.
Review: We checked the unit and default independently. E-40 specifies 1,000 milliseconds. E-43 agrees. The finding does not assert an observed cluster setting. We checked units and distinguished the default from cluster configuration. E-40 specifies 1,000 milliseconds. The fetched PostgreSQL 18 documentation independently confirms one second.

Sources:
- [REL_18_6 · src/backend/utils/misc/guc_tables.c:2266-2274](https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/utils/misc/guc_tables.c#L2266-L2274)
  Excerpt:
  ```text
  GUC_UNIT_MS
		},
		&DeadlockTimeout,
		1000, 1, INT_MAX,
  ```
- [https://www.postgresql.org/docs/current/runtime-config-locks.html](https://www.postgresql.org/docs/current/runtime-config-locks.html)
  Excerpt:
  ```text
  The default is one second ( 1s )
  ```

Finding URL: https://pgtrue.postgres.ai/shared/brief/f01d0141-796c-4a87-a3bf-3ec19aa9cc7d#F14

### F15 · Accurate · Factual · The stated throughput rates imply a 55% reduction
Location: Article · exact quote · [open in article](https://aws.amazon.com/blogs/database/troubleshooting-row-lock-contention-in-amazon-aurora-postgresql-part-1-understanding-row-lock-contention-in-postgresql#:~:text=Throughput%20dropped%20to%20approximately%204%2C900,second%2C%20a%2055%20percent%20reduction)
Article says:
```text
Throughput dropped to approximately 4,900 transactions per second, a 55 percent reduction…
```
What is true:
Throughput falls by 55.0% (derived: 100 × (10,900 − 4,900) / 10,900). The remaining throughput is 45.0% of baseline. Both percentages match the article's rounding.
Charitable reading:
The article rounds both throughput rates and the percentage.
Explanation: Checked for internal consistency: the evidence is the article itself.
Review: We recalculated the reduction as 55.0459% and remaining throughput as 44.9541%. Both round correctly. The finding verifies arithmetic, not measurements or causation. We recomputed the reduction as 55.0459% and remaining throughput as 44.9541%. Both round as stated. The finding verifies arithmetic without authenticating measurements or attributing causation.

Finding URL: https://pgtrue.postgres.ai/shared/brief/f01d0141-796c-4a87-a3bf-3ec19aa9cc7d#F15

## Notes (not graded) (2)

### F1 · Note ·  · Note: “It then acquires a temporary tuple lock in shared memory…”
Location: excerpt · section “How locks work in PostgreSQL” · as fetched 2026-10-21 · [open in article](https://aws.amazon.com/blogs/database/troubleshooting-row-lock-contention-in-amazon-aurora-postgresql-part-1-understanding-row-lock-contention-in-postgresql#:~:text=It%20then%20acquires%20a%20temporary%20tuple%20lock%20in%20shared%20memory)
Article says:
```text
It then acquires a temporary tuple lock in shared memory…
```
What is true:
Heavyweight tuple-lock acquisition is conditional, as README.tuplock:36-37 and heapam.c:5150-5152 show. The article describes the contended path without stating that qualification. Its monitoring advice already uses transaction-ID waits and pg_blocking_pids(). The wording does not establish wasted diagnostic work.
So what:
Use transaction-ID waits and pg_blocking_pids() to diagnose contention. Do not expect every locked row to have a heavyweight tuple-lock entry.
Explanation: Not graded: no reader would act differently on it.
Review: The acquisition caveat survives, but the claimed diagnostic cost does not. The article describes temporary locks and already recommends transaction-ID diagnostics. F1's reader action repeats that advice. The unconditional acquisition description is wrong. The claimed diagnostic cost does not follow. The article explains temporary lock release and recommends transaction-ID monitoring. Its monitoring guidance already matches the proposed reader action.

Sources:
- [REL_18_6 · src/backend/access/heap/README.tuplock:36-37](https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/access/heap/README.tuplock#L36-L37)
  Excerpt:
  ```text
  starve out waiting exclusive-lockers.  However, if there is not any active
conflict for a tuple, we don't incur any extra overhead.
  ```
- [REL_18_6 · src/backend/access/heap/heapam.c:5150-5152](https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/access/heap/heapam.c#L5150-L5152)
  Excerpt:
  ```text
  if (!skip_tuple_lock &&
				!heap_acquire_tuplock(relation, tid, mode, wait_policy,
									  &have_tuple_lock))
  ```
- [REL_18_6 · src/backend/access/heap/heapam.c:5480-5485](https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/access/heap/heapam.c#L5480-L5485)
  Excerpt:
  ```text
  /*
	 * Now that we have successfully marked the tuple as locked, we can
	 * release the lmgr tuple lock, if we had it.
	 */
	if (have_tuple_lock)
		UnlockTupleTuplock(relation, tid, mode);
  ```

Finding URL: https://pgtrue.postgres.ai/shared/brief/f01d0141-796c-4a87-a3bf-3ec19aa9cc7d#F1

### F9 · Note ·  · The blockers array contains blocking PIDs
Location: excerpt · section “Monitoring locks using system views and functions” · as fetched 2026-10-21 · [open in article](https://aws.amazon.com/blogs/database/troubleshooting-row-lock-contention-in-amazon-aurora-postgresql-part-1-understanding-row-lock-contention-in-postgresql#:~:text=blocking%20process%20ID%20%28%20pid%20%29)
Article says:
```text
…blocking process ID ( pid )…
```
What is true:
The pid column identifies the inspected session. The blockers array contains that session's blocking process IDs. The example correctly shows session 2053 blocked by session 1943. Only the introductory column label reverses these meanings.
Charitable reading:
The displayed blockers array and example output communicate the relationship correctly. The introductory column label is the defect.
Explanation: Not graded: knowing this would not change what a reader does.
Review: We tested the charitable reading that the query returns both kinds of PID. It does. The note correctly limits the defect to the introductory label. We checked whether the introductory wording changes the displayed diagnosis. The output identifies blockers correctly. E-14 confirms that pg_blocking_pids() supplies blocker identifiers. A note matches the limited wording defect.

Sources:
- [REL_18_6 · doc/src/sgml/func.sgml:25002-25005](https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/doc/src/sgml/func.sgml#L25002-L25005)
  Excerpt:
  ```text
  One server process blocks another if it either holds a lock that
        conflicts with the blocked process's lock request (hard block), or is
        waiting for a lock that would conflict with the blocked process's lock
        request and is ahead of it in the wait queue (soft block).  When using
  ```
- [REL_18_6 · src/backend/utils/adt/lockfuncs.c:553-554](https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/utils/adt/lockfuncs.c#L553-L554)
  Excerpt:
  ```text
  /* blocked by this entry, so emit a record */
			arrayelems[narrayelems++] = Int32GetDatum(instance->leaderPid);
  ```

Finding URL: https://pgtrue.postgres.ai/shared/brief/f01d0141-796c-4a87-a3bf-3ec19aa9cc7d#F9

## Withdrawn findings (0)

None.

## Section checks

- Lock internals · A · 2 verified-accurate · 75% of claims (12 of 16, plus 1 that need data we do not have)
- Row lock example · A · 2 verified-accurate · 92% of claims (12 of 13)
- Flash-sale load · A · 1 verified-accurate · 1 checked · 9 need data we do not have
- System views · A · 2 verified-accurate · 100% of claims (18 of 18, plus 4 that need data we do not have)
- Row lock inspection · A · 1 verified-accurate · 100% of claims (10 of 10, plus 2 that need data we do not have)
- Lock wait logging · A · 3 verified-accurate · 100% of claims (4 of 4, plus 4 that need data we do not have)
- Conclusion · A · 1 verified-accurate · 100% of claims (3 of 3)

## Claim coverage

- Introduction: 5 of 5 Postgres claims checked, plus 3 that need data we do not have; not counted: 3 product or opinion, 1 duplicate, 3 not a claim
- Prerequisites: 0 of 1 Postgres claims checked, plus 1 that need data we do not have; not counted: 6 product or opinion; not checked: 1 for other reasons
- Lock internals: 12 of 16 Postgres claims checked, plus 1 that need data we do not have; not counted: 2 product or opinion, 1 duplicate, 1 not a claim; not checked: 4 for other reasons
- Row lock example: 12 of 13 Postgres claims checked; not counted: 3 duplicate, 1 not a claim; not checked: 1 for other reasons
- Workload schema: 3 of 3 Postgres claims checked, plus 12 that need data we do not have; not counted: 5 product or opinion, 1 duplicate, 3 not a claim
- Average load: 0 of 2 Postgres claims checked, plus 10 that need data we do not have; not counted: 1 product or opinion, 2 duplicate, 1 not a claim; not checked: 2 for other reasons
- Flash-sale load: 1 checked, plus 9 that need data we do not have; not counted: 4 product or opinion, 6 duplicate, 1 not a claim
- Contention scenarios: no checkable claims; not counted: 5 product or opinion, 1 duplicate
- Monitoring locks: no checkable claims; not counted: 1 product or opinion, 2 not a claim
- System views: 18 of 18 Postgres claims checked, plus 4 that need data we do not have; not counted: 2 duplicate
- Row lock inspection: 10 of 10 Postgres claims checked, plus 2 that need data we do not have; not counted: 1 not a claim
- Lock wait logging: 4 of 4 Postgres claims checked, plus 4 that need data we do not have; not counted: 3 duplicate, 1 not a claim
- Cleanup: no checkable claims; not counted: 12 product or opinion, 2 not a claim
- Conclusion: 3 of 3 Postgres claims checked; not counted: 4 product or opinion, 6 duplicate, 2 not a claim
- Authors: no checkable claims; not counted: 8 not a claim

## What we did not check

- We did not reproduce the throughput, wait-event percentages, or session measurements the article displays.
- We did not inspect the article's five dashboard figures.
- We did not verify the accompanying schema, data generator, workload scripts, or retry implementation.
- We did not verify Aurora's storage implementation or service-specific configuration and cleanup behavior.
- We did not verify the CloudWatch transaction metric or its mapping to completed orders.
- We did not finish checking checkpoint writes or the investigation approach's applicability to every workload.
- We did not read the five Database Insights chart images or verify their underlying measurements.
- We did not reproduce the displayed SQL outputs or workload measurements.
- We did not inspect the workload scripts or CloudFormation templates to verify their behavior.
- We did not establish equal applicability of every Aurora monitoring feature to RDS PostgreSQL.
- We did not establish post-publication changes to Aurora monitoring features.
- We did not verify the claimed lock frequency, memory comparison, concurrency improvement, or reduction in deadlock risk.
- We did not reproduce the throughput and lock-wait measurements.
- We did not read Figures 1–5 to verify the throughput charts or the 95% database-load total.
- We did not verify the test's row counts, session counts, item counts, or db.r8g.4xlarge instance configuration.
- Safe: we did not complete every applicable check.
- Section “Prerequisites”: we checked 0 of 2 checkable claims.
- Section “Average load”: we checked 0 of 12 checkable claims.
- We could not decide whether the article contains a material benchmark.

## Notes

- A — the findings address the article's main subject. What we did not check is listed below. The findings directly check Part 1’s row-lock mechanisms, blocking-session queries, row inspection, and lock-wait logging.
- We did not check everything in this article. What we did not check is listed below, in the words we recorded at the time. None of it moved the letter. We never charge our own limits to the article.
- Average of 3 axes: 4 · result A
- Some explanatory text is not shown in this edition; the grade and findings are complete.
- Some checks did not happen for this edition, and each one we know of is listed above.
- Checked against: github.com/postgres/postgres REL_18_6 at commit 724edf9bde9d356724ad384a2e196edc3c9f80f7 (pinned target); https://aws.amazon.com/blogs/database/category/database/amazon-aurora/ (fetched 2026-10-21T03:57:02.190035Z); https://aws.amazon.com/blogs/database/category/database/amazon-rds/rds-for-postgresql/ (fetched 2026-10-21T03:57:06.096928Z); https://aws.amazon.com/blogs/database/category/learning-levels/advanced-300/ (fetched 2026-10-21T03:56:58.885703Z); https://aws.amazon.com/blogs/database/category/post-types/technical-how-to/ (fetched 2026-10-21T03:57:09.005685Z); https://aws.amazon.com/blogs/database/resolve-amazon-aurora-postgresql-lock-contention-with-database-insights-part-2/ (fetched 2026-10-21T03:57:13.349151Z); https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-console-delete-stack.html (fetched 2026-10-21T03:57:31.879227Z); https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/configure-root-volume-delete-on-termination.html (fetched 2026-10-21T03:57:32.473289Z); https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/terminating-instances.html (fetched 2026-10-21T03:57:33.067760Z); https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/CHAP_GettingStartedAurora.AuroraPostgreSQL.FullConfig.html (fetched 2026-10-21T03:57:14.002683Z); https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_DatabaseInsights.TurningOnAdvanced.html (fetched 2026-10-21T03:57:14.649662Z); https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/apg-waits.cpu.html (fetched 2026-10-21T03:57:24.420408Z); https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/apg-waits.lockbuffercontent.html (fetched 2026-10-21T03:57:23.750124Z); https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/apg-waits.locktransactionid.html (fetched 2026-10-21T03:57:26.939483Z); https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/apg-waits.locktuple.html (fetched 2026-10-21T03:57:28.270763Z); https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/apg-waits.lw-lock-manager.html (fetched 2026-10-21T03:57:27.620391Z); https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/apg-waits.xactsync.html (fetched 2026-10-21T03:57:23.103359Z); https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/ec2-rds-connect.html (fetched 2026-10-21T03:57:15.332335Z); https://docs.aws.amazon.com/ebs/latest/userguide/ebs-deleting-volume.html (fetched 2026-10-21T03:57:33.679996Z); https://www.postgresql.org/docs/current/app-psql.htm (fetched 2026-10-21T03:57:17.521347Z); https://www.postgresql.org/docs/current/ddl-system-columns.html (fetched 2026-10-21T03:57:20.420033Z); https://www.postgresql.org/docs/current/explicit-locking.html (fetched 2026-10-21T03:57:10.184933Z); https://www.postgresql.org/docs/current/monitoring-stats.html (fetched 2026-10-21T03:57:30.188631Z); https://www.postgresql.org/docs/current/runtime-config-locks.html (fetched 2026-10-21T03:57:31.223784Z).
- Article captured 2026-10-21T03:56:36.416361Z · SHA-256 437a366130cbcf237c05ddab371b44753a62903733361e944003f942e80517da · Text extracted from the article's HTML.
- Policy SHA-256 852a1939150b0b14f41b2e81de99d2d6281db079343714415f459d8e44841f76 · Grading rules SHA-256 6fb334e79d6b9e7ed81d3238cc10d9de602ff87ed65ff2fa781f53bac5798765.
- We did not reproduce the displayed SQL outputs, throughput measurements, or wait-event percentages.
- We did not read Figures 1–5 to verify the dashboard measurements or the 95% database-load total.
- We did not verify the accompanying schema, data generator, workload scripts, retry implementation, or CloudFormation templates.
- We did not verify the workload’s row counts, session counts, item counts, or db.r8g.4xlarge configuration.
- We did not verify Aurora’s storage implementation, service-specific configuration, cleanup behavior, or equal monitoring-feature availability on RDS PostgreSQL.
- We did not verify the CloudWatch transaction metric’s mapping to completed orders.
- We did not verify the claimed lock frequency, memory comparison, concurrency improvement, checkpoint-write behavior, or reduction in deadlock risk.
- We did not establish post-publication changes to Aurora monitoring features.
- The article gives September 14, 2026, without a time. We list that date at midnight UTC.
- source: the article names no postgres release, so it was read at REL_18_6, the latest release when it was published
- One fetched page is not listed above, because our policy does not allow linking it.
- review: the findings were written by one model and reviewed independently by a different model.
- 2026-10-30: Regraded under the current grading rules: the letter is the average of the axis letters, with every cap stated under it.
- 7 passages in this edition fell short of our own plain-English rules.
- Built from the article text captured above, one pinned source tree, and 23 fetched pages.
- 12 survived · 3 weakened · 0 withdrawn.

## Revision history

- [Revision 1](https://pgtrue.postgres.ai/shared/brief/f01d0141-796c-4a87-a3bf-3ec19aa9cc7d?v=2) · 2026-10-16 12:37 UTC · B · audited with v1.0.8 (approx.)
  Article as first submitted. 10 accurate · 0 wrong · 1 caveat.
  ElephantSeal: B. Open: the benchmark cannot yet be rerun from what is published.
  Changes: First audit. Open: F1 “Temporary tuple locks arbitrate conflicts” (mostly accurate).
- [Revision 2](https://pgtrue.postgres.ai/shared/brief/f01d0141-796c-4a87-a3bf-3ec19aa9cc7d?v=4) · 2026-10-18 18:00 UTC · B · audited with v1.0.11 (approx.)
  Same article text, re-audited. 13 accurate · 0 wrong · 0 caveats.
  ElephantSeal: B. Open: the benchmark cannot yet be rerun from what is published.
  Changes: No longer reported: “Temporary tuple locks arbitrate conflicts”. New: none.
- [Revision 3](https://pgtrue.postgres.ai/shared/brief/f01d0141-796c-4a87-a3bf-3ec19aa9cc7d?v=6) · 2026-10-18 21:51 UTC · A · audited with v1.0.12 (approx.)
  Same article text, re-audited. 13 accurate · 0 wrong · 0 caveats.
  ElephantSeal: A.
  Changes: No change in findings.
- [Revision 4](https://pgtrue.postgres.ai/shared/brief/f01d0141-796c-4a87-a3bf-3ec19aa9cc7d?v=8) · 2026-10-19 03:35 UTC · A · audited with v1.0.13 (approx.)
  Same article text, re-audited. 14 accurate · 0 wrong · 0 caveats.
  ElephantSeal: A.
  Changes: No change in findings.
- [Revision 5](https://pgtrue.postgres.ai/shared/brief/f01d0141-796c-4a87-a3bf-3ec19aa9cc7d?v=10) · 2026-10-19 21:33 UTC · A · audited with v1.0.16 (approx.)
  Same article text, re-audited. 13 accurate · 0 wrong · 0 caveats.
  ElephantSeal: A.
  Changes: No change in findings.
- [Revision 6](https://pgtrue.postgres.ai/shared/brief/f01d0141-796c-4a87-a3bf-3ec19aa9cc7d?v=13) · this page · 2026-10-21 03:56 UTC · A · audited with v1.0.17 (approx.) · regraded with v1.1.3
  Same article text, re-audited. 12 accurate · 0 wrong · 0 caveats.
  ElephantSeal: A.
  Changes: No change in findings.

Updated your article? Request a correction. A new edition appears at this address.