From 80741b41d6ff09fdd395775f87b99098b589c16e Mon Sep 17 00:00:00 2001
From: Alpha Shuro <alphashuro@gmail.com>
Date: Wed, 15 Oct 2025 17:55:05 +0200
Subject: [PATCH] document ShareLock behaviour when using a deferred unique
 index

The logs that were printed by Postgres
when enforcing deferred unique indexes were misleading.

This change should make it easier to understand or investigate
when users see the `waits for ShareLock` log entry
---
 doc/src/sgml/mvcc.sgml | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/doc/src/sgml/mvcc.sgml b/doc/src/sgml/mvcc.sgml
index 049ee75a4ba..4e36c59776a 100644
--- a/doc/src/sgml/mvcc.sgml
+++ b/doc/src/sgml/mvcc.sgml
@@ -1016,6 +1016,11 @@ ERROR:  could not serialize access due to read/write dependencies among transact
         <para>
          Acquired by <command>CREATE INDEX</command>
          (without <option>CONCURRENTLY</option>).
+
+         It is also acquired when enforcing a DEFERRED UNIQUE INDEX:
+         If a transaction detects another transaction that might cause
+         a potential conflict, it waits for the other transaction to complete,
+         by acquiring a ShareLock on the other transaction's transaction id.
         </para>
        </listitem>
       </varlistentry>
-- 
2.51.0

